


The problem: We have created a menu with optionSplit, for the last menuitem you have 2 css classes.
How we can see easily at the following picture the last menueitem depends on the item before, it does need a dark or a light background.
With optionSplit its quite simple to change the 2 colors. But how you know if the last item needs a light or dark background?
Have a look at following typoscript snippet:
temp.mymenu=HMENU temp.mymenu.1=TMENU temp.mymenu.1.NO { # optionSplit for the first menuitem and the following, one dark one light allWrap = | |*| |||||*| allWrap.override.cObject=COA allWrap.override.cObject{ # the override of the allWrap property is executed if the actual menuitem (register:count_HMENU_MENUOBJ) is the last(register:count_menuItems) if.value.data=register:count_menuItems if.equals.data=register:count_HMENU_MENUOBJ 10=TEXT 10{ # sets the light class for a odd count of the menuitems value=| if.isFalse.prioriCalc=1 if.isFalse.cObject=TEXT if.isFalse.cObject.insertData=1 if.isFalse.cObject.value={register:count_HMENU_MENUOBJ}%2 } 20<.10 # Negate the whole thing and set the dark class in this case 20.if.negate=1 20.value=| } }
More information:
tsref stdWrap (override,prioriCalc)
2 menues: divide pages in even and odd
Forum thread that leadet to this solution (german)


Comments (0)