SiteProcessor

The SiteProcessor fetches data from the site configuration.

Options

as
Required

false

Data type

string

Default

"site"

The variable name to be used in the Fluid template.

Example: Output some data from the site 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_dataprocsite =< lib.contentElement
    examples_dataprocsite {
        templateName = DataProcSite
        # Before TYPO3 v12.1 you have to specify the fully-qualified class name of the processor
        # dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\SiteProcessor
        # Since TYPO3 v12.1 one can also use the available alias
        dataProcessing.10 = site
        dataProcessing.10 {
            as = site
        }
    }
}

New in version 12.1: One can use the alias site instead of the fully-qualified class name \TYPO3\CMS\Frontend\DataProcessing\SiteProcessor.

The Fluid template

In the Fluid template the properties of the site 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">{site}</f:debug>

   <h2>Output</h2>

   <p>Base url: <f:link.page pageUid="{site.rootPageId}">{site.configuration.base}</f:link.page></p>

</html>

Output

The array now contains the information from the site configuration:

../../../_images/SiteProcessor.png