Skip to content

Instantly share code, notes, and snippets.

@michelalbers
Created January 21, 2015 19:14
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save michelalbers/fb0c2e04af1d6ff94788 to your computer and use it in GitHub Desktop.
Save michelalbers/fb0c2e04af1d6ff94788 to your computer and use it in GitHub Desktop.
Language Switcher in TYPO3 with tx_news support
lib.menuLanguage = COA
lib.menuLanguage {
10 = HMENU
10 {
special = language
special.value = 1,2
stdWrap.wrap = <ul class="language-select">|</ul>
1 = TMENU
1 {
# Normal link to language that exists:
NO = 1
NO {
additionalParams.cObject = TEXT
additionalParams.cObject {
data = GP:tx_news_pi1|news
stdWrap.wrap = &tx_news_pi1[news]=|
stdWrap.required = 1
}
allWrap = <li class="en">|</li> |*| <li class="ru">|</li>
stdWrap {
setCurrent = Englisch || Pусский
current = 1
}
}
# Translation does not exist
USERDEF1 < .NO
USERDEF1.allWrap = <li style="display:none;">|</li>
USERDEF1.doNotLinkIt = 1
}
}
}
@ursbraem
Copy link

Hi Michel, I stumbled over your snippet as I'm having some troubles with USERDEF and tx_news: http://stackoverflow.com/questions/40270726/typoscript-menu-userdef1-and-userdef2-states-stopped-working-for-tx-news

Maybe you have some TYPO3 7.6.11 Sites running with this config? I'd be interested to find out if you get the unlinked language for untranslated news.

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