[TYPO3-english] How can I give each menu item a different class? (optionSplit?)

Philipp Gampe philipp.gampe at typo3.org
Sun Dec 30 22:15:27 CET 2012


Hi Jörg,

Jörg Klein wrote:

> Yepp, right. But the class won't change automatically, when pages are
> being moved. My problem is that e.g. the third page in the menu always
> must have the class "three", no matter, which page it actually is. I want
> to avoid human work to change these classes, because otherwise I fear that
> wrong classes have to be fixed again and again. And the formula, by which
> the classes have to be applied, is so simple.
> 
> In the menu object TYPO3 "knows", how many pages have been rendered
> already (at least there is this internal pointer). I think the solution
> must be somewhere there, inside the HMENU TypoScript code...

So you want to use something like:
NO.wrapItemAndSub.dataWrap = <li class="no {register:count_MENUOBJ}">|</li>

You may also try the {debug:data} to see what is there.

There is also count_HMENU_MENUOBJ and count_HMENU.

Best regards
-- 
Philipp Gampe – PGP-Key 0AD96065 – TYPO3 UG Bonn/Köln
Documentation – linkvalidator
TYPO3 .... inspiring people to share!



More information about the TYPO3-english mailing list