For a couple of websites now, I decided to cut the menu into two parts:
The idea is following for this very website whose pages’ hierarchy is similar to:
root
|-- Tutorials
| |-- TYPO3
| | |-- Complete website
| | `-- …
| `-- LaTeX
| |-- Articles
| `-- …
|-- Programming
| `-- …
|-- Multimedia
`-- Internet
The goal is to get a list with main topics:
That’s easy as we only need to configure a single level of menu entries:
lib.menu = HMENU lib.menu.1 = TMENU lib.menu.1 { noBlur = 1 wrap = <ul>|</ul> NO { wrapItemAndSub = <li>|</li> ATagTitle.field = description // subtitle // title } ACT = 1 ACT { wrapItemAndSub = <li class="active">|</li> ATagTitle.field = description // subtitle // title } }
The goal is to get a list of pages for the currently selected topic. Thus, if “Tutorials” is active, we should get:
That’s easy with the parameter entryLevel:
lib.submenu = HMENUlib.submenu.entryLevel = 1lib.submenu.1 = TMENU lib.submenu.1 { # Expand next sublevel expAll = 1 noBlur = 1 wrap = <ul>|</ul> NO { wrapItemAndSub = <li>|</li> ATagTitle.field = description // subtitle // title } ACT = 1 ACT { wrapItemAndSub = <li class="active">|</li> ATagTitle.field = description // subtitle // title } } lib.submenu.2 < lib.submenu.1 lib.submenu.2 { # Do not expand further expAll = 0 } lib.submenu.3 < lib.submenu.2 lib.submenu.4 < lib.submenu.3
I only configured 4 sublevels of menu entries, but I think you got it, didn’t you? You may have noticed too, that I defined lib.menu and lib.submenu. These are 2 objects that I may include in my TemplaVoilà! template.
Interesting Links
