[TYPO3] setting different styles for the first and last item in a menu..

Christopher bedlamhotel at gmail.com
Thu Oct 12 17:02:55 CEST 2006


Hello,

On 10/12/06, Nico Potvin <nico.potvin at kandesign.com> wrote:
> That did the trick..
>
> thank you very much..
>
> greets
>
> nico
> On 12 Oct 2006, at 11:41, Klaus Musset wrote:
>
> > temp.hmenu = HMENU
> > temp.hmenu.1 = TMENU
> > temp.hmenu.1 {
> >    wrap = <ul> | </ul>
> >     NO {
> >        allWrap = <li id="start">|</li> |*| <li>|</li> |*| <li
> > id="menuend">|</li>
> >        ATagBeforeWrap = 1
> >        }
> >     ACT < .NO
> >     ACT = 1
> >     ACT.linkWrap = <span id="active">|</span>
> >     }


But as Tyler pointed out, this is slightly absure HTML. The way to
solve the problem of two id attributes on one element is NOT to
introduce a new element (the span). Instead, change the start/menuend
ids to classes so that the html looks like this:

<ul>
       <li class="start"><a href="#">Menu item1</a></li>
       <li><a href="#">Menu item1</a></li>
       <li id="active"><a href="#">Menu item1</a></li>
       <li><a href="#">Menu item1</a></li>
       <li><a href="#">Menu item1</a></li>
       <li><a href="#">Menu item1</a></li>
       <li class="menuend"><a href="#">Menu item1</a></li>
</ul>

Even if that's not useful to you for some reason, you can always apply
the active item's id attribute with ATagParams:

ACT.ATagParams = id="active"

...all without introducing any excess markup.


Christopher / bedlamhotel.com



More information about the TYPO3-english mailing list