site-language data processor

New in version 12.1

The \TYPO3\CMS\Frontend\DataProcessing\SiteLanguageProcessor , alias site-language, fetches language-related data from the site configuration.

Options

Name Type Default
string "site"

as

as
Type
string
Required
false
Default
"site"

The variable name to be used in the Fluid template.

Example: Output some data from the site language configuration

Please see also About the examples.

TypoScript

Using the SiteLanguageProcessor the following scenario is possible:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/SiteLanguageProcessor.typoscript
tt_content {
    examples_dataprocsitelanguage =< lib.contentElement
    examples_dataprocsitelanguage {
        templateName = DataProcSiteLanguage
        # Before TYPO3 v12.1 you have to specify the fully-qualified class name of the processor
        # dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\SiteLanguageProcessor
        # Since TYPO3 v12.1 one can also use the available alias
        dataProcessing.10 = site-language
        dataProcessing.10 {
            as = language
        }
    }
}
Copied!
The Fluid template

In the Fluid template the properties of the site language configuration can be accessed:

EXT:examples/Resources/Private/Templates/ContentElements/DataProcSiteLanguage.html
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers">
<h2>Data in variable site</h2>
<f:debug inline="true">{language}</f:debug>

<h2>Output</h2>

<p>language id: {language.languageId}</p>

</html>
Copied!
Output

The array now contains the information from the site language configuration: