Search code examples
yamltypo3configtyposcripttypo3-10.x

Using constants of site config in TypoScript conditions


In TYPO3 10 LTS it is possible to set constants in the site config and use them in typoscript (see here: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/SiteHandling/UseSiteInTypoScript.html)

I was wondering if I can also use the constants in typoscript and tsconfig conditions, e.g.

[page["pid"] == "{$site.settings.uids.privacy}"] 
    here goes the typoscript configuration for the conditon
[END]

I set the constants in the site config this way:

rootPageId: 1
(...)
settings:
  uids:
    privacy: 124
    meta: 127

Any ideas?


Solution

  • Just read the changelog, Benjamin. :D

    It is possible, for further information please take a look: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.4/Feature-91080-SiteSettingsAsTsConstantsAndInTsConfig.html.

    Above example would look like:

    [page["pid"] == "{$uids.privacy}"] 
        here goes the typoscript configuration for the conditon
    [END]