0

We are using EE 2.5.5 and Playa 4.4.2.

We are setting the "status" field dynamically on our site. We need to be able to use Playa like so:

{if {myfield:total_children status="{embed:status}"}}{/if}

This currently renders as an "invalid conditional" in EE. If we remove the brackets, it seems to work:

{if myfield:total_children}{/if}

However there is no way to pass the "status" parameter in this way. So we tried using Switchee:

{exp:switchee 
    parse="inward" 
    variable="{myfield:total_children parse='inward' status='{embed:status}"}

    {case value="''"}
        AAA
    {/case}

    {case default="Yes"}
        BBB
    {/case}

{/exp:switchee}

This will output "AAA" every time, no matter what. I'm running out of options. Does anyone know how this functionality can be achieved? We need to detect if there are ANY children that match the "status" criteria. If not, then we need to show an alternate message.

  • Is this in the context of other code, such as a channel entries tag? Can you paste your entire template into your original question, please? – Lisa May 8 '13 at 21:03
  • It looks like the "parse_conditionals" parameter of {exp:stash:set} is the cause. -- {exp:stash:set parse_conditionals="yes" parse_tags="yes"} {exp:channel:entries channel="home-page" dynamic="off"} {if {home-featured-coupons:total_children}}{/if} {/exp:channel:entries} {/exp:stash:set} -- I guess I will follow up with Mark Croxton to get his thoughts. Thanks for your help. – wise_gremlin May 8 '13 at 22:12

Your Answer

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

Browse other questions tagged or ask your own question.