Help get this topic noticed by sharing it on Twitter Twitter, Facebook Facebook, or email.
Emily
indifferent I’m perplexed

Playa field total_children tag doesn't work inside a conditional statement

I've got 2 different related content fields which I want to show in an ASIDE. I only want the aside tag to be printed if there is content in either of these fields so I check for it first. But this doesn't work:


{if ("{pf_event_related_event:total_children show_expired="no"}" >= "1") || ("{pf_event_related_content:total_children show_expired="no"}" >= "1")}
<aside>
{if "{pf_event_related_event:total_children show_expired="no"}" >= "1"}
<h2>Related events</h2>
{pf_event_related_event
status="{gs_status_default}"
orderby="date"
sort="desc"
limit="3"
show_future_entries="yes"
show_expired="no"
}

{gs_event_listing_short}
{/pf_event_related_event}
{/if}
{pf_event_related_content
status="{gs_status_default}"
orderby="date"
sort="desc"
limit="3"
}
{gs_content_listing_short}
{/pf_event_related_content}
</aside>
{/if}


However...

If I print the total_children tags outside of the if statement, which I've done inside an HTML comment, the above code works.

<!--{pf_event_related_event:total_children show_expired="no"} {pf_event_related_content:total_children show_expired="no"}-->

I guess this might just be a general parse order thing - and let me know if I'm better off going to regular EE forums to shed light on this one!
1 person has
this problem
+1
Reply