

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> }




phy
(don't you wish wrapItemAndSub had stdWrap properties too!)
I tried above code snippet but not working.
In HTML it shows {field:uid} and not actual uid.
I have latest Typo3 4.4 version.
Please help me.
Let's try this:
lib.menu = HMENU
lib.menu {
1 = TMENU
1 {
noBlur = 1
wrap = <ul id="menu">|</ul>
NO {
before.cObject = HTML
before.cObject {
value {
dataWrap = <li id="{field:uid}">|
}
}
wrapItemAndSub = |</li>
}
}
}
Add comment