Created
May 10, 2015 01:28
-
-
Save uschmelzer/816afad27137179b8c5c to your computer and use it in GitHub Desktop.
Simple language switcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<f:layout name="Page"/> | |
<div xmlns="http://www.w3.org/1999/xhtml" lang="en" | |
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" | |
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"> | |
<f:section name="SimpleLanguageSwitcher"> | |
<!-- Get current language id, e.g. 0, 1 --> | |
<!-- In my case 0 = German, 1 = English --> | |
<f:if condition="{v:page.language(normalWhenNoLanguage: 1)} == 1"> | |
<f:then> | |
<!-- If current language id is 1 e.g. English, --> | |
<!-- create link to current page and --> | |
<!-- add &L=0 GET Param to switch to german language --> | |
<v:link.typolink configuration="{parameter: page.uid, additionalParams: '&L=0'}">Deutsch</v:link.typolink> | |
</f:then> | |
<f:else> | |
<v:link.typolink configuration="{parameter: page.uid, additionalParams: '&L=1'}">English</v:link.typolink> | |
</f:else> | |
</f:if> | |
</f:section> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment