Using site configuration in TypoScript and Fluid templates

getText

Site configuration can be accessed via the site property in TypoScript.

Example:

page.10 = TEXT
page.10.data = site:base
page.10.wrap = This is your base URL: |
Copied!

Where site is the keyword for accessing an aspect, and the following parts are the configuration key(s) to access.

data = site:customConfigKey.nested.value
Copied!

To access the current siteLanguage use the siteLanguage prefix:

page.10 = TEXT
page.10.data = siteLanguage:navigationTitle
page.10.wrap = This is the title of the current site language: |

page.10 = TEXT
page.10.dataWrap = The current site language direction is {siteLanguage:direction}
Copied!

Site configuration can also be used in TypoScript conditions and as TypoScript constants.

FLUIDTEMPLATE

You can use the SiteProcessor in the FLUIDTEMPLATE content object to fetch data from the site entity:

tt_content.mycontent.20 = FLUIDTEMPLATE
tt_content.mycontent.20 {
    file = EXT:myextension/Resources/Private/Templates/ContentObjects/MyContent.html

    dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\SiteProcessor
    dataProcessing.10 {
        as = site
    }
}
Copied!

In the Fluid template the properties of the site entity can be accessed with:

<p>{site.rootPageId}</p>
<p>{site.configuration.someCustomConfiguration}</p>
Copied!

Specific Site settings can be accessed via:

<p>{site.configuration.settings.mySettingKey}</p>
<p>{site.settings.all.mySettingKey}</p>
Copied!

Non-Extbase Fluid view

Deprecated since version 13.3

In a non-Extbase Fluid view (\TYPO3\CMS\Core\View\ViewInterface ), created manually by the Using the generic view factory (ViewFactoryInterface), you can use the PHP API to access the site settings (see The Site object), then assign that object to your Fluid standalone template, and finally access it through the same notation in the Fluid template of a FLUIDTEMPLATE.