[TYPO3-english] TMENU

JoH asenau info at cybercraft.de
Tue Jun 23 16:40:01 CEST 2009


> 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.

Try this one instead to get rid of additional stdWrap function calls for
"if":

lib.mainMenu.1.NO.allWrap.cObject = CASE
lib.mainMenu.1.NO.allWrap.cObject {
    key.dataWrap = L{TSFE:page|layout}P{field:uid}
    default = TEXT
    default.value = <li>|
    L1P1301 = TEXT
    L1P1301.value = <li class="current">|
    L2P1300 < .L1P1301
    L3P1295 < .L1P1301
    L4P1296 < .L1P1301
}

The dataWrap used for key generates a combination of layout (L) and page uid
(P).
the default for all combinations is no class at all, except the combinations
listed as TEXT.
Since the value is the same for all of them, you can simply copy the setup
of the first one.

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
TYPO3 workshops: http://workshops.eqony.com




More information about the TYPO3-english mailing list