I try to make a typo3 template condition that will change pert of the html template depending on the language.
I have three languages id: 0, 2 and 3.
I use:
Typo3 12.4.9
Bootstrap 14.0.7
I have tried this and similar variants, but don't really have a clue what I need to do.
<f:if condition="{siteLanguage.languageId}=={1}">
<f:then>
<div>language 1</div>
</f:then>
<f:if else>
<div>language 2</div>
</f:if else>
<f:else>
<div>default language</div>
</f:else>
</f:if>
Please can someone help me solve this?
Thanks
First you can check if the variable siteLanguage is available in your Fluid Template:
will output die siteLanguage object (if available, otherwise "null")
will output all variables that are available so you can also see if siteLanguage is listed there.
Second, the condition should be
as you are comparing a variable with a number - the number must not be in curly brackets.
If you do not have the siteLanguage variable available in the Fluid template, you'll need to pass the siteLanguage to your FLUIDTEMPLATE TypoScript settings as a variable first, so that it becomes available in the Fluid template. Here's how you can do this in TypoScript:
Then, in your Fluid template, you can use languageUid to make conditional checks like so: