Alex Kellner of in2code recently wrote the following slick piece of TypoScript for creating a language selector menu.
lib.menu_lang = HMENU lib.menu_lang { special = language special.value = 0,1,2,3 special.normalWhenNoLanguage = 0 wrap = <ul id="menu_lang">|</ul> 1 = TMENU 1 { noBlur = 1 NO = 1 NO { linkWrap =<ul><li>|</li></ul>|*|<ul><li>|</li></ul>|*|<ul><li class="last">|</li></ul> stdWrap.override = deutsch || english || français || español } ACT < .NO ACT { ATagParams = class="act" } USERDEF1 < .NO USERDEF1 { doNotLinkIt = 1 } USERDEF2 < .ACT USERDEF2 { doNotLinkIt = 1 } } }
Notes
- Language ids are given in
special.value = 0,1,2,3
which match with the same order of the language labels found instdWrap.override = deutsch || english || français || español
. - The currently selected language is not clickable.
References
- TSRef HMENU
- TSRef TMENU
- Similar Sprach-Menü via TYPO3 Blogger using typolink