Aug
4
2007
4
2007
Menu with dynamic css class for submenus
This snippet creates a menu where every menuitem on the 1.level has a own id. Using this id you can format the submenu with css selectors.
In this example a nested unordered list is created where to every mainmenupoint the css id menuitemUID is addet. UID is here the unique ID of the page.
lib.menu=HMENU
lib.menu{
1 = TMENU
1.wrap=<ul>|</ul>
1.NO{
allWrap.insertData=1
# change to allWrap=<li id=”menuitem{field:title}”>| if you want the title instead of the uid as css id
allWrap=<li id=”menuitem{field:uid}”>|
wrapItemAndSub = |</li>
}
2<.1
2.NO.allWrap=|
2.NO.wrapItemAndSub=<li>|</li>
}
An article by





