Site settings
New in version 13.1
Site settings can receive a type, a default value and some documentation in site settings definitions. It is recommended to always define a site setting before using it, as only this way you can ensure proper types and default values.
Changed in version 13.4.15
The settings in settings.
are stored as map instead of tree.
Important: #106894 - Site settings.yaml is now stored as a map
Site settings can be used to provide settings for a site. They can be accessed via
- the \TYPO3\CMS\Core\Site\Entity\Site object in frontend and backend context using PHP
- the siteSettings key of the data function in TypoScript
- constants in TypoScript or page TSconfig
- as variables (for example,
{site.
) in Fluid templates using theconfiguration. settings. my Setting Key} Site
, see Using site configuration in TypoScript and Fluid templates.Processor data processor
For instance, settings can be used in custom frontend code to deliver features which might vary per site for extensions. An example may be to configure storage page IDs.
All changes made in the site settings editor are stored in the settings.
file located in config/
. If this file does not exist, TYPO3
will create it automatically.
Note
You can use imports
in settings.
. However, as soon as you save
changes in the site settings editor, TYPO3 rewrites the file and all
imports
will be removed.
To store values independently of the site settings editor, use the
settings.
file in the folder Configuration/
of your
site package. This file itself remains untouched, but its values are
overwritten by values from the settings.
in config/
.
Note
As this file is not modified by the site settings editor, you can safely
use imports
here if needed. Absolute paths, relative paths and the
EXT:
syntax are supported.
Adding site settings
Add settings to the settings.yaml
:
Changed in version 13.4.15
The settings in settings.
are stored as map instead of tree.
Important: #106894 - Site settings.yaml is now stored as a map
Note
This example shows how to fill a constant of
EXT:felogin via site settings
(
styles.
) and configures a custom
category
.
Accessing site settings in page TSconfig or TypoScript
// store tx_ext_data records on the given storage page by default (e.g. through IRRE)
TCAdefaults.tx_ext_data.pid = {$categoryPid}
// load category selection for plugin from out dedicated storage page
TCEFORM.tt_content.pi_flexform.ext_pi1.sDEF.categories.PAGE_TSCONFIG_ID = {$categoryPid}
Note
The TypoScript constants are evaluated in this order:
- Configuration from $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']
- Site specific settings from the site configuration
- Constants from
sys_
database recordstemplate