[TYPO3] Giving the first and last items in a menu an extra class
Bas van der Togt
bas.vander.togt at efocus.nl
Tue Dec 18 17:52:57 CET 2007
Stephen,
What is your problem with optionsplit?
This should work for you:
NO.allWrap = <li class="thirst>|</li> |*| <li class="middle>|</li> |*|
<li class="last>|</li>
kind regards,
Bas
Stephen Bungert wrote:
> A piece of my current code:
>
> lib.mainNav.1 {
>
> # Normal state properties
> NO.stdWrap.htmlSpecialChars = 1
>
> # Allow adding the Uid to wrap HTML
> NO.subst_elementUid = 1
> NO.ATagBeforeWrap = 1
> NO.allWrap = <li class="menuMain-no" id="mainMenuLi{elementUid}"> | </li>
> NO.ATagParams = id="mainMenuLiA{elementUid}"
>
>
> # Enable active state and set properties:
> ACT = 1
> ACT.stdWrap.htmlSpecialChars = 1
> ACT.allWrap = <li class="menuMain-act" id="mainMenuLi{elementUid}"> |
> </li>
>
> # Remove link form active menu items
> CUR = 1
> CUR.stdWrap.htmlSpecialChars = 1
> CUR.doNotLinkIt = 1
> CUR.allWrap = <li class="menuMain-cur" id="mainMenuLi{elementUid}"> | </li
>
> }
>
> Is it possible tot o make the first item and last item in a menu have a
> different class? I need the first item to have the class 'first' and the
> last item 'last'.
>
> Hi do this with typoscript? Conditions based on id number? I'd rather have
> something that works automatically incase pages are added later. I thought
> maybe using optionSplit, there's even an example in tsrf for menus, but this
> is only for submenus. How can you do this on a top level menu?
>
More information about the TYPO3-english
mailing list