[TYPO3-english] TMENU

Stefano Kowalke blueduck at gmx.net
Tue Jun 23 14:57:13 CEST 2009


Am 23.06.2009 12:46 Uhr, schrieb JoH asenau:
> You should use a CASE for that:
> 
> allWrap.cObject = CASE
> allWrap.cObject {
>     key.data = TSFE:pages|layout
>     default = TEXT
>     default.value = <li>|
>     1 = TEXT
>     1.value = <li class="layout1">|
>     2 = TEXT
>     2.value = <li class="layout1">|
>     3 = TEXT
>     3.value = <li class="layout1">|
> }

This is nearly the right solution ;-) but this TS inserts in every
<li>-tag the layout class. As result i have a menu where all entries
have the same class f.e. if the value of layout in the page = 1 (for
yellow pages) all entries have the class="layout_1" class.

I modify this TS to:

lib.mainMenu.1.NO.allWrap.cObject = CASE
lib.mainMenu.1.NO.allWrap.cObject {
	key.data = TSFE:page|layout
	default = TEXT
	default.value = <li>|
	1 = TEXT
	1.value = <li class="current">|
	1.if.equals.field = uid
	1.if.value = 1301
	2 = TEXT
	2.value = <li class="current">|
	2.if.equals.field = uid
	2.if.value = 1300
	3 = TEXT
	3.value = <li class="current">|
	3.if.equals.field = uid
	3.if.value = 1295
	4 = TEXT
	4.value = <li class="current">|
	4.if.equals.field = uid
	4.if.value = 1296
}

Now, TS insert the "current"-class only to one menuitem (in case we
visit a yellow page, the menuitem "about yellow pages" get the class)

Thanks all for your help
Stefano


More information about the TYPO3-english mailing list