Attention
TYPO3 v10 has reached end-of-life as of April 30th 2023 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
Using Site Config in Conditions¶
Site configuration may be used in all conditions that use Symfony Expression language
Typo3ConditionFunctionsProvider
- at the moment this means in EXT:form variants
and TypoScript conditions.
Two objects are available: site
and siteLanguage
.
With site
you can access the properties of the top level site configuration.
siteLanguage
accesses the configuration of the current site language.
TypoScript Examples¶
The identifier of the site name is evaluated:
[site("identifier") == "someIdentifier"]
page.30.value = foo
[global]
Property of the current site language is evaluated:
[siteLanguage("locale") == "de_CH.UTF-8"]
page.40.value = bar
[global]
EXT:form Examples¶
Translate options via siteLanguage
condition:
renderables:
-
type: Page
identifier: page-1
label: DE
renderingOptions:
previousButtonLabel: 'zurück'
nextButtonLabel: 'weiter'
variants:
-
identifier: language-variant-1
condition: 'siteLanguage("locale") == en_US.UTF-8'
label: EN
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'