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

Jörg Klein joerg at klein-family.com
Sat Dec 29 21:49:15 CET 2012


Hi guys,

I have a normal HMENU. On the first level I want each page to be wrapped in 
a ul-tag with several classes.

No comes the problem: One of these classes should be different for every 
page. (I guess that is maybe easiest by using "one", "two", "three" as class 
names.)

So for the first four pages the menu should for example look like this:
<ul class="selectable one"><li>.....</li></ul>
<ul class="current two"><li>.....</li></ul>
<ul class="selectable three"><li>.....</li></ul>
<ul class="selectable four"><li>.....</li></ul>

Here is the relevant part of TypoScript I have right now:
  HEAD = HMENU
  HEAD {
    # Level 1
    1 = TMENU
    1 {
      NO = 1
      NO {
        wrapItemAndSub = <ul class="selectable"><li>|</li></ul>
      }
    ACT = 1
    ACT {
        wrapItemAndSub = <ul class="current"><li>|</li></ul>
    }
  }

The question is: How do I get these changing classes added to these ul tags?

Cheers!

Jörg

 




More information about the TYPO3-english mailing list