The ezini operator
This page is for designers who read settings in templates: the site name, a list of stylesheets, a theme option.
Contents
The call
ezini( 'SiteSettings', 'SiteName' ) {* site.ini when no file is given *}
ezini( 'StylesheetSettings', 'CSSFileList', 'design.ini' )
ezini( 'NodeSettings', 'RootNode', 'content.ini' )Parameters (kernel/common/ezurloperator.php): section, setting, file (default site.ini), and an optional directory.
The value is read for the current siteaccess, with every override applied.
Testing first
Reading a setting that does not exist is a template warning. When a setting is optional (for example one your theme adds, which an installation may not have yet):
if ezini_hasvariable( 'SiteInfo', 'PrivacyPolicyID', 'menu.ini' )
...
/ifThe media design's pagelayout/head/script.tpl does this before reading its privacy page setting.
Lists
An INI list (Setting[]=a, Setting[]=b) comes back as an array, so it can go straight into an operator that takes
arrays:
ezcss_load( array( 'mytheme.css', ezini( 'StylesheetSettings', 'FrontendCSSFileList', 'design.ini' ) ) )
if ezini( 'Header', 'LandingClasses', 'mytheme.ini' )|contains( $node.class_identifier ) ... /ifA settings file for your theme
Design choices that may differ per site belong in a settings file of the theme, not in templates. The starter theme
has cjw_jumper.ini with [Header], [Menu] and [LayoutSettings], read by its templates with
ezini( ..., 'cjw_jumper.ini' ). Your theme's settings/mytheme.ini.append.php with defaults, overridden per
siteaccess, works the same way (Giving a theme its own settings file).
When to use settings
- Yes: ids of special content (by remote id), lists of classes, on/off switches, file lists.
- No: texts (use
i18n), anything secret (templates must never print secrets), values that change per request.
Related pages
- Operators overview
- The ezhttp operator
- 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.