Sprachmenü (Language menu) via TypoScript

by Michael Cannon in TYPO3 · 0 comments

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 in stdWrap.override = deutsch || english || français || español.
  • The currently selected language is not clickable.

References

Be Sociable, Share!

Related Entries

About Michael Cannon

Hello, I'm Michael Cannon, Peichi's smiling man, an adventurous water-ratchief technology officer, cyclist, poet, WWOOF'er and world traveler.

Previous post:

Next post: