0

I'm using Zoo Visitor and Playa.

I have tried lots of different conditionals for "if no playa parent" to show the title of a parent entry for a Zoo Visitor member.

I'd like to display something else if there is no parent. However, can't seem to find a technique that works. Techniques 1, 2 and 3 all print out the parent title, but they don't print out the else condition.

Any solutions or ideas would be much appreciated.

Thanks!

1)

{exp:zoo_visitor:details}
{exp:playa:parents channel="channel_name"} 

{if count == 1}

    {title}

{if:else}

    Do something else

{/if}

{/exp:playa:parents}
{/exp:zoo_visitor:details}

2)

{exp:zoo_visitor:details}
{exp:playa:parents channel="channel_name"} 

    {if count > 0}

        {title}

    {if:else}

        Do something else

 {/if}

{/exp:playa:parents}
{/exp:zoo_visitor:details}

3

{exp:zoo_visitor:details}
{exp:playa:parents channel="channel_name"} 

{if {exp:playa:total_parents} > 0}

    {title}

{if:else}

    Do something else

{/if}

{/exp:playa:parents}
{/exp:zoo_visitor:details}

4) Doesn't even echo out the title

{exp:zoo_visitor:details}
{exp:playa:parents channel="channel_name"} 

     {if total_parents == 1}

            {title}

    {if:else}

            Do something else

   {/if}

{/exp:playa:parents}
{/exp:zoo_visitor:details}
0

This should work:

{if total_results > 0}
    {title}
{/if}

{if no_parents}
    Something else
{/if}
1
  • Legend! That worked perfectly. Thank you for your time!
    – jx3
    Sep 23 '14 at 23:31

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.