Settings files in an extension
This page is for designers who add settings to a theme. Every active extension's settings/ folder is read by the
settings system, after the kernel's defaults and before the installation's own overrides.
The file format
A settings file of an extension is named after the settings file it changes, with .append.php:
/* #?ini charset="utf-8"?
[ExtensionSettings]
DesignExtensions[]=mytheme
*/ - The
<?php /* ... */ ?>around the settings keeps a web server from showing them as text if someone requests the file directly. #?ini charset="utf-8"?states the encoding. Use UTF-8 for new files.- A line
Variable[]alone (with nothing after the brackets) empties an array before new entries are added.
Which settings a theme usually ships
| File | What a theme puts there |
|---|---|
design.ini.append.php | DesignExtensions[], its stylesheet and script lists |
override.ini.append.php | Template override rules (Override basics) |
image.ini.append.php | Image aliases the theme's templates use (Image aliases) |
site.ini.append.php | Only what is safe for every siteaccess, for example a template operator's registration |
<theme>.ini | The theme's own options (Giving a theme its own settings file) |
Where settings win
From weakest to strongest: the kernel's settings/*.ini, siteaccess settings (first those inside extensions, then
settings/siteaccess/<siteaccess>/), the active extensions' settings/ (earlier extensions win over later ones),
and finally the installation's settings/override/. So a value in your theme's settings/ wins over the same value in
a siteaccess; only settings/override/ wins over it. The full list is in
Settings override placements.
Step by step: add and check a setting
Create or edit the file in
extension/mytheme/settings/.Clear the INI cache:
php bin/php/ezcache.php --clear-tag=ini --allow-root-user.See every file that sets the variable and the value in effect:
./console exp:ini where image.ini/AliasSettings/AliasList --allow-root-userExpected: your extension's file among the files, in load order, and the value in effect.
Rules
- Never put passwords, API keys or tokens into a theme's settings. An extension holding secrets cannot even be exported as a package (The secret check).
- Never ship
settings/override/in a theme: that folder belongs to the installation. - Comment each block: the next maintainer (or you in two years) needs the reason.
Related pages
- Siteaccess settings inside a theme
- Extensions guide, section 5: configure it
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.