1

I'm trying to show data conditionally based on a relationship having more than 1 child (see below). When I output the var {exp:playa:total_children field="cf_lookbook_products" entry_id="{entry_id}"} anywhere in the DOM, the conditional returns true, however if I do not include it, then it returns false always. That var also returns the correct number of children.

{if {exp:playa:total_children field="cf_relationship_field" entry_id="{entry_id}"} > 1}
content here
{/if}
1

Make sure you put your conditional inside of your {exp:channel:entries ...} tag for the {entry_id} to work.

If that doesn't help, what code do you have around this conditional?

UPDATE

Change your quotes to look like this

{if "{exp:playa:total_children field='cf_relationship_field' entry_id='{entry_id}'}" > 1}
content here
{/if}
| improve this answer | |
  • Conditional is in the loop. I literally have the var dumping in to a data attribute the line before that. When the var is present, the conditional works. Conditional only, no beuno. – Ryan Shrum Oct 23 '13 at 20:40
  • Okay. See update. – Stephen Callender Oct 23 '13 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.