Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,155 of 9,155 pages
About the help in other languages
All help pages

Override basics

How template overrides work: a rule in override.ini names a source template, the template that replaces it and the conditions; where rule files live (siteaccess, extension, extension siteaccess); how the kernel finds…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/templates/override-ini-basics.md

On this page

Override basics

This page is for designers who want a different template for some content: articles, one special page, everything in a section. An override is a rule: "when the template Source is used for content that matches these conditions, use MatchFile instead".

Contents

  1. A rule
  2. Where rules live
  3. How the replacement is found
  4. When several rules match
  5. Managing overrides in the administration
  6. Caches

A rule

[mytheme_full_article]
Source=node/view/full.tpl
MatchFile=full/article.tpl
Subdir=templates
Match[class_identifier]=article
Priority=10
KeyMeaning
section nameunique name of the rule; prefix it with your theme
Sourcethe template being replaced, a path under templates/
MatchFilethe replacement, a path under override/templates/
Subdirtemplates (the folder kind; always this value in designs)
Match[<key>]conditions; all must be true (Override match keys); none means always
Priorityorder of evaluation, lowest first; rules without one come last (Override ordering)

The kernel's settings/override.ini shows the syntax as a commented example and holds no rules itself.

Where rules live

Rules are read from override.ini with all its append files, for the current siteaccess:

  • settings/siteaccess/<siteaccess>/override.ini.append.php (the siteaccess's own);
  • an extension's settings/override.ini.append.php (every siteaccess where the extension is active);
  • an extension's settings/siteaccess/<siteaccess>/override.ini.append.php (that siteaccess only; how the media and starter themes ship theirs).

Prefer the extension's siteaccess file for a theme: its rules then never touch the administration or other sites.

How the replacement is found

When Source is requested, the kernel checks the rules for it in order; the first whose conditions all match wins. Its MatchFile is searched under override/templates/ in every design base of the cascade (eZTemplateDesignResource::overrideArray() in kernel/common/eztemplatedesignresource.php). A MatchFile found in no design is reported in the error log ("Custom match file: path ... not found in any resource").

When several rules match

Only the first rule in order counts. Give specific rules (one node) a lower Priority than general ones (a class), so they are checked first. See Override ordering.

Managing overrides in the administration

Design > Template Editor (/visual/templatelist) lists the templates of a siteaccess with their overrides, creates new ones (written with Priority=0), reorders them by drag and drop and edits the files (Template editor: create, order and edit overrides). For a theme in an extension, keep the rules in the extension's files, under version control.

Caches

After adding a rule or an override template: php bin/php/ezcache.php --clear-tag=ini and --clear-id=template-override. Then --clear-id=content for full views already cached.

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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x