SiteLanguageProcessor

New in version 12.0: The Data Processor SiteLanguageProcessor has been introduced, which can be used to fetch the properties of the current SiteLanguage within Fluid Templates in TYPO3 Frontend rendering.

Please see also About the examples.

TypoScript

The SiteLanguageProcessor fetches language related data from the site configuration.

Options:

as
Required:false
Type:string
Default:“site”

The variable’s 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 SiteProcessor the following scenario is possible:

EXT:examples/Configuration/TypoScript/DataProcessors/Processors/SiteProcessor.typoscript
tt_content {
   examples_dataprocsitelanguage =< lib.contentElement
   examples_dataprocsitelanguage {
      templateName = DataProcSiteLanguage
      dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\SiteLanguageProcessor
      dataProcessing.10 {
         as = language
      }
   }
}

The Fluid template

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

EXT:examples/Resources/Private/Templates/ContentElements/DataProcSite.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>

Output

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

../../../_images/SiteLanguageProcessor.png