[TYPO3-english] Add Custom Class to menu all li tag

bernd wilke t3ng at bernd-wilke.net
Wed Sep 3 08:46:54 CEST 2014


Am 02.09.14 14:23, schrieb yogesh shishangiya:
> Hi ,
>
> I create menu and its working successfully. now i want to add custom
> style to my every li of first level so i add class to like below.

[...]
>          wrapItemAndSub = <li class="home">|</li>|*|<li
> class="service">|</li>|*|<li class="contact">|</li>|*|<li
> class="l">|</li>|*|<li class="about">|</li>

[...]
>
> But Problem occured first class of li apply to first and second apply to
> still before last. and last menu get third li tag class .. Can any one
> know right method for it ? what mistake i done ?

"optionsplit" is not easy to understand. especially the priority of 
assignment.

in case you need a linear asigment from first to last existing element 
you should use the second level of otionsplit:

wrapItemAndSub = <li class="home">|</li> || <li class="service">|</li> 
|| <li class="contact">|</li> || <li class="l">|</li> || <li 
class="about">|</li>

but that solution is basically not a good solution as it is not flexible 
enough to take care of modifications to the page structure.
it would be better to use any page property (e.g. name in lowercase, 
alias, ...) to use as class inserted automatically.

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list