Hi,
I’m confused trying to use hierarchical parameters in a Pages loop, to build a Table of Content for the current section being browsed by the user:
Here’s my pages hierarchy on 3 levels:
Level 1 page
– Level 2 pages
–– Level 3 pages
And i need to display the same section menu on all pages:
- The section title (Level 1 page)
- A list of Level 2 pages
- Lists of Level 3 pages nested under their Level 2 parents (above)
I guess my questions are:
- For point 1: how to get Level 1 page from any level of the hierarchy (1, 2 or 3)?
- For point 2 and 3: how to limit the loops to Level 2 and 3 pages?
Here’s how i did with CCS, now i need to reproduce with L&L:
<div class="title">
[loop child=this]
[if first]
[field title-link]
[set section_top_level][field slug][/set]
[/if]
[/loop]
</div>
<div class="menu">
[pass vars]
<ul>
[loop type=page parent={SECTION_TOP_LEVEL} orderby=menu]
<li>[field title-link]
[-loop exists parent=this orderby=menu]
<ul>
[the-loop]
<li>[field title-link]</li>
[/the-loop]
</ul>
[/-loop]
</li>
[/loop]
</ul>
[/pass]
</div>
Thanks for your help!