Skip to content

Instantly share code, notes, and snippets.

@markhowellsmead
Last active July 18, 2016 14:27
Show Gist options
  • Save markhowellsmead/10391556 to your computer and use it in GitHub Desktop.
Save markhowellsmead/10391556 to your computer and use it in GitHub Desktop.
TypoScript: create a language-switching menu to other language versions of the current page
# 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>
}
}
@matueszwin
Copy link

Hello,

I added this code as you mentioned, but nothing happens, Is there anything more I should do ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment