Working on TYPO3 4.7 with Templavoila 1.7.0, I need a way to customize one value of the template according to the order of the current page in its navigation level.
In specific, I need to change the class attribute of a div to "left" or "right" if its even or uneven. Is there a way to do this with maybe a Templavoila Typoscript-Attribute?
For an example:
- Main Page
- Page 1
- Page 1.1 -> When rendering this page I want to set the class attribute to "left"
- Page 1.2 -> "right"
- Page 1.3 -> "left"
- Page 1.4 -> "right"
- Page 2
- Page 3
- Page 1
Thanks!
A TemplaVoila TypoScript Attribute would fail, if someone change the sorting of the pages.
I would try to render a menu. With allWrap.cObject = TEXT it should be possible to override the output. So just create a menu which renders the class, and depending on even or odd render the class you need.
!pseudo-code!
Did not test the code, so if it does not work, check for syntax. Probably deactivate override, check the value REGISTER:count_HMENU_MENUOBJ but i guess it should be the register you need.