Using L&L Inside a Category Archive

@werlecreative we haven’t had a chance to fix/release this, but it’s on the to-do list. I’ll follow up here when this is resolved.

1 Like

Does the most recent version address this issue? 3.1.8?

I’m not sure when the fix was released, but both methods in the solution above are working as expected in version 3.1.8

Hi everyone!

I’d like to go one step further in this topic and output multi-level hierarchical terms in a Taxonomy Archive.

The 3 levels hierarchy:

Parent term
– Child term
–– Grand-child term

The L&L template:

<ul>
<Loop field=archive_term>
  <h3><Field title /> / id<Field id /> (<Field count />)</h3>
  <ul>
  <Loop field=children>
    <li>
      <Field title /> (<Field count />)
      <ul>
      <Loop field=children>
        <li><a href="{Field url}"><Field title /> (<Field count />)</a></li>
      </Loop>
      </ul>
    </li>
  </Loop>
  </ul>  
</Loop>

Output:

Parent Term / idx (x)
– Child Term (x)
–– Grand-child Term (x)
– Grand-child Term (x)

It’s almost fine except the 3rd level ‘Grand-child term’ is returned both in the nested loops 2 and 3.
Is there a way to limit <Loop field=children> to a single terms hierarchy level?
In other words, exclude level 3 Grand-child terms from loop 2 and only return direct children.

Thanks for your help. :wink:

Thanks to ChatGPT, i have a PHP shortcode to achieve this now, as a backup.
I’d be interested to know if it’s possible with L&L though.

2 Likes