I have a page structure like so:
- About us (lvl 1)
-- About us 1 (lvl 2)
-- About us 2 (lvl 2)
-- About us 3 (lvl 2)
--- Detail about us 3 (lvl 3)
--- Detail about us 3 (lvl 3)
-- About us 4 (lvl 2)
- Our great products (lvl 1)
-- Great products (lvl2)
--- Detail great products (lvl 3)
Each lvl 2 page has a right-hand menu showing all the other lvl2 pages with the same lvl1 parent. It's rendered with Typoscript like this:
lib.side_buttons_submenu = CONTENT
lib.side_buttons_submenu {
table = pages
select {
orderBy = sorting
recursive = 0
selectFields = uid, subtitle
}
renderObj = TEXT
renderObj {
field = subtitle
required = 1
typolink.parameter.field = uid
wrap = <li>|</li>
}
wrap = |
}
This outputs:
<ul class="side_buttons">
<li>About us 1</li>
<li>About us 2</li>
<li>About us 3</li>
<li>About us 4</li>
</ul>
I want to add the lvl3 pages beneath the lvl 2 pages, and add class="parent" if the page has subpages, so the side menu looks like this:
<ul class="side_buttons">
<li>About us 1</li>
<li>About us 2</li>
<li class="parent">About us 3
<ul>
<li>Detail about us 3</li>
<li>Detail about us 3</li>
</ul>
</li>
<li>About us 4</li>
</ul>
I can't find an example of this anywhere in the Typoscript documentation- does anyone have a snippet to show me how to do it?