Kentico text/xml transformation conditional statmement -
i have transformation, used repeater, slider. working well. have slide caption, isn't required. i'm struggling conditional statement caption tag doesn't show.
here's transformation:
<section class="imageslide"> <figure role="group"> <img src="{% slideimage %}" alt="{% slidealt %}"> <figcaption><p>{% slidecaption %}</p></figcaption> </figure> </section>
what i'm hoping not render figcaption if there no slidecaption. slidecaption isn't required item. had though if using jquery change display type of <p></p>
tags empty, want avoid lot of dom manipulation.
i know syntax this, haven't found example can use base solution.
{% if(....) %}
something should work. didn't test it, may need tweaks.
{% ifempty(slidecaption, "","<figcaption><p>" + slidecaption + "</p></figcaption> ") %}
Kentico 12 migration You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this...
ReplyDelete