newzero
7/10/2014 - 10:29 PM

navigation.language.txt

# Create a language-switching menu to other language versions of the current page
# If the page is not translated, the language label will be shown but not linked.
# ACT is the current language, not CUR.

# Add the following code to an existing typoscript base in TYPO3.
# This code alone is not sufficient to make a working website :)
# m@mhm.li - 04/2014 - Free use, no credit required
 
 
# Add the following to TS Constants:
config {
	language {
		uids = 0,1,2
		labels = DE||FR||IT
	}
}

# Add the following to TS Setup:
lib.menu.language = HMENU
lib.menu.language {
	special = language
	addQueryString = 1
	special.value = {$config.language.uids}
	1 = TMENU
	1 {
		wrap = <ul class="language">|</ul>
		NO = 1
		NO {
			stdWrap.current = 1
			stdWrap.setCurrent = {$config.language.labels}
			allWrap = <li>|</li>
		}

		ACT < .NO
		ACT.doNotLinkIt = 1
		ACT.allWrap = <li class="act">|</li>
	}
}