0

I'm trying to get a Super Search results loop that only displays entries with No Parents...

I'm currently pulling out all the results and just showing a label for the entries that don't have a Playa parent:

{exp:super_search:results channel="zoo_visitor" status="Members-id5|Members_Verified_-id6|Members_Pro-id7|open" orderby="date" sort="desc" limit="50" paginate="bottom" }

{if channel_name == 'zoo_visitor'}

    {exp:zoo_visitor:details} 

    <li>

      <strong>{mbr_formal_title} {member_firstname} {member_lastname} ({entry_id})</strong> 

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

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

        {if no_parents}
            <span class="tip">No Parent</span>
        {/if}

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

    <hr>
    </li>

    {/exp:zoo_visitor:details}

{/if}  

<!-- Pagination Snippet -->
{_pagination}

{/exp:super_search:results}

Also happy to use default EE entries tag if it's easier / Super Search is causing the problem. Guessing it shouldn't make a difference though?

Edit (Response to question):

I tried this but it seems to spit out blank entries with parents...

{exp:super_search:results channel="zoo_visitor" status="open" orderby="date" sort="desc" limit="50" paginate="bottom" }

  {exp:zoo_visitor:details}
  {exp:playa:parents channel="parents"} 
     {if no_parents}
      <li> {mbr_formal_title} {member_firstname} {member_lastname ({entry_id})</li>
    {/if}
  {/exp:playa:parents}
  {/exp:zoo_visitor:details}

{_pagination}

{/exp:super_search:results}  
  • What seems to be the problem? You don't like the loop depth? Slow queries? Just expand the namespace of your inner most loop and put everything inside that no_parents conditional. – jrothafer Sep 24 '15 at 12:48
  • When I put everything inside the no parents conditional, it still spits out blank list items for entries with parents. I just want to display ones without and nothing else. Hopefully that made sense?! Added an example above. – jx3 Sep 24 '15 at 15:24
  • So something with no parents gets this: <li> Output you wanted </li> but stuff with parents gets this <li> <!-- blank list item --> </li> ? – jrothafer Sep 24 '15 at 15:43
  • Exactly. It's almost feels like the {if no_parents} tag needs to come with the entry tag. – jx3 Sep 24 '15 at 16:31
  • tried adding an empty else clause? {if no_parents} stuff goes here {if:else}{/if} – jrothafer Sep 24 '15 at 16:33

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.