I need to display some fields in a Elementor Single Template based on conditions like: if the user is logged in or based on date values of the field.
As there is no option to do this in Elementor when selecting a field, I have tried the following:
Using the Shortcode- and HTML Elementor Widgets and added the code for conditions there, but without any success.
Before Views 2.6.4 I simply could make a Views Content Template with all the conditional fields in it and it loaded perfectly in the Elementor Post Content Widget.
Any hint is highly appreciated
Hi, can you share the conditional code you have tried in the HTML Elementor widget?
Hi Christian
thanks for your reply and looking into this.
the code looks like this:
{!{wpv-conditional if="( $(wpcf-event-start-date) lte 'TODAY()' ) AND ( $(wpcf-event-end-date) gte 'TODAY()' )"}!}{!{types field="event-slurl" title="Teleport to Event" class="ts-event-list-detail-link" target="_blank"}!}{!{/wpv-conditional}!}
{!{toolset_access role="Administrator"}!}{!{wpv-conditional if="( $(wpcf-event-start-date) lte 'TODAY()' ) AND ( $(wpcf-event-end-date) gte 'TODAY()' )" evaluate="false"}!}{!{types field="event-slurl" title="Event Location" class="ts-event-list-detail-link" target="_blank"}!}{!{/wpv-conditional}!}{!{/toolset_access}!}
In a Views single template it works perfectly but I cant get this to work in an Elementor Pro Single Template.
Hi Christian
I found it: instead of the {!{ }!} i used [ ] and then it works when using an Elementor Text widget.
Probably they where leftovers from using previously Divi Builder
Okay, let me know if this issue is not resolved.
My issue is resolved now. Thank you!