[TYPO3-english] Subject: changing wrap for first and last menu items

David Bruchmann typo3-en at bruchmann-web.de
Thu May 14 08:10:45 CEST 2009


----- Ursprüngliche Nachricht -----
Von:        David Banning <david at skytracker.ca>
Gesendet:   Donnerstag, 14. Mai 2009 05:25:59
An:         Farooq <farooqaassi at gmail.com>
CC:         typo3-english at lists.netfielders.de
Betreff:    Re: [TYPO3-english] Subject: changing wrap for first and 
last	menu	items
>>    You need to wrap your menu this way to give different classes to first
>>    and last li's generated,
>>>>    �  wrap = <ul id="yacbddm" class="firstLevel"> | </ul>� �  //�  this is
>>    outer UL within which li's will appear
>>    � � � �  NO.allWrap = <li class="first"> | </li> |*| <li
>>    class="normal"> | </li> |*| <li class="last"> | </li>� �  // this is
>>    parttdioning li's into three parts first, last and all in-between as
>>    normal
>>    I have not told about what to do when there need be active class or so,
>>    if more script is needed, say back.
> 
> Yes - Thanks for that Farooq - I did find that in a thread somewhere
> but ran into problems because of another class. So how is this configuration
> handled in operation with ACT, CUR or IFSUB?
> 

Hello David,

when you want to asssign two classes per item you can use the following 
TS, in my example each item has on of the classes [first|normal|last] 
assigned, furthermore each item gets the current itemState as class too:

xyz = HMENU
xyz {
	wrap = <ul id="yacbddm" class="firstLevel"> | </ul>
	1 = TEMNU
	###### All in One Line - start #####
	1.NO.wrapItemAndSub = <li class="first NO"> | </li> |*| <li 
class="normal NO"> | </li> |*| <li class="last NO"> | </li>
	###### All in One Line - end #####

	1.IFSUB < .1.NO
	1.IFSUB = 1
	###### All in One Line - start #####
	1.IFSUB.wrapItemAndSub = <li class="first IFSUB"> | </li> |*| <li 
class="normal IFSUB"> | </li> |*| <li class="last IFSUB"> | </li>
	###### All in One Line - end #####

	1.ACT < .1.NO
	1.ACT = 1
	###### All in One Line - start #####
	1.ACT.wrapItemAndSub = <li class="first ACT"> | </li> |*| <li 
class="normal ACT"> | </li> |*| <li class="last ACT"> | </li>
	###### All in One Line - end #####

	1.CUR < .1.NO
	1.CUR = 1
	###### Optional: Don't link current item ######
	1.CUR.doNotLinkIt = 1
	###### All in One Line - start #####
	1.CUR.wrapItemAndSub = <li class="first CUR"> | </li> |*| <li 
class="normal CUR"> | </li> |*| <li class="last CUR"> | </li>
	###### All in One Line - end #####

	2 < .1
	2.wrap = <ul class="level_2">|</ul>

	3 < .1
	3.wrap = <ul class="level_3">|</ul>

	4 < .1
	4.wrap = <ul class="level_4">|</ul>
}

For the itemStates in the moment it doesn't make any sense to write 
1.IFSUB < .1.NO but when .1.NO is more complicated alle properties of 
.1.NO automatically are assigned to the other itemStates too.

For the classes of li-elements you als can assign other classnames also 
only one name, but combining different names makes CSS easier because 
you can manage two different classes independent from hirarchy.

Below 2 < .1, 3 < .1, ... you can overwrite defined properties that are 
taken from .1, so you needn't define the whole TMENU new for each level.

You can view exactly this menu in the content area on 
http://www.bruchmann-web.de/de/support/typo3/tipps-und-tricks/navigation 
(Headline: "Normales Menu mit Option Split")
To view the HTML-source-code just search for your outer class yacbddm.

Best regards
David


More information about the TYPO3-english mailing list