Skip to the content
Documentation

Extension siteaccess settings

No ratings yet

An extension can carry settings for a single siteaccess. This keeps everything a site needs (its design, its override rules, its siteaccess settings) inside one extension that you can install, copy or put under version control as a unit.

Where the files go

extension/<extension>/settings/siteaccess/<siteaccess>/<file>.ini.append.php

For example, an override rule that applies to the siteaccess site only:

<?php /* #?ini charset="utf-8"?
# extension/mysite/settings/siteaccess/site/override.ini.append.php

[article_full]
Source=node/view/full.tpl
MatchFile=full/article.tpl
Subdir=templates
Match[class_identifier]=article

*/ ?>

When the files are read

  • The extension must be active: listed in site.ini [ExtensionSettings] ActiveExtensions[] in settings/override/ (an extension activated only inside a siteaccess's own settings is activated too late to supply them).
  • They are read right after the defaults and before settings/siteaccess/<siteaccess>/, so the siteaccess's own files, the active extensions' general settings and settings/override/ can still change them. See the layers in Configuration.
  • When the extension has a directory for the current siteaccess, its settings/override/ directory is read too, at the same level. A multi-site installation uses this for settings that belong to one site's siteaccesses only.
  • A siteaccess can take over the extension settings of another one with site.ini [SiteAccessSettings] ExtensionSettingsSiteAccess=<other siteaccess>, set in its own settings/siteaccess/<name>/site.ini.append.php. A translation siteaccess uses this to share the design and extension settings of the main one.

Settings needed before the siteaccess is known, such as the siteaccess matching itself and the list of active extensions, cannot be set this way. Check where a value comes from with ./console exp:ini where <file>/<block>/<setting> <siteaccess>: extension siteaccess files are listed with the scope extension:<name>:siteaccess:<siteaccess>. More: Per-site settings inside extensions.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.