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

Template overrides for site builders

Give one class, one section, one node or one view mode its own template with an override rule - by click path in the template editor or as files in your design extension - and the match keys you can use.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/creators/website-creators/template-overrides.md

On this page

Template overrides for site builders

This page is for website creators who want a template for a particular kind of page: articles look one way, products another, the front page a third. An override is a rule in override.ini that says "for pages matching these conditions, use this file instead of the standard template". The step-by-step tutorial is 4. Make a change with an override; this page is the site builder's reference.

Contents

  1. The parts of a rule
  2. Match keys
  3. A full and a line template per class
  4. Click path or files
  5. Order: which rule wins
  6. Checklist

The parts of a rule

# settings/siteaccess/<site>/override.ini.append.php
[full_article]
Source=node/view/full.tpl
MatchFile=full/article.tpl
Subdir=templates
Match[class_identifier]=article
KeyMeaning
[full_article]the block name; any unique name
Sourcethe template being replaced
MatchFileyour file, relative to design/<design>/override/templates/
Subdiralways templates
Match[...]the conditions; all must hold
Priorityoptional; rules with a priority come first, the lowest number first

Match keys

For node views, the kernel offers these keys (kernel/classes/eznodeviewfunctions.php):

KeyExampleUse it for
class_identifierarticlea template per class (the most common)
class2the same by class ID
node2one location (the front page)
object1234one object, at all its locations
parent_node58everything directly in one folder
section / section_identifiermemberseverything in a section
state / state_identifieran object statecontent in a workflow stage
depth2top-level pages
url_aliasAbout-usone address
remote_id, node_remote_idcontent created by imports, stable across installations
viewmodelinea view mode, for templates not keyed by Source
class_groupall classes of a class group
navigation_part_identifieradmin navigation parts

Prefer class_identifier, section_identifier, state_identifier and node_remote_id over IDs: identifiers mean the same on every installation, IDs do not.

A full and a line template per class

Most sites need two templates per class: full (the page of the item) and line (the item in a list).

[full_event]
Source=node/view/full.tpl
MatchFile=full/event.tpl
Subdir=templates
Match[class_identifier]=event

[line_event]
Source=node/view/line.tpl
MatchFile=line/event.tpl
Subdir=templates
Match[class_identifier]=event

design/<design>/override/templates/full/event.tpl:

<article class="event">
  <h1>{$node.name|wash}</h1>
  {attribute_view_gui attribute=$node.data_map.start_date}
  {attribute_view_gui attribute=$node.data_map.description}
</article>

design/<design>/override/templates/line/event.tpl:

<li><a href={$node.url_alias|ezurl}>{$node.name|wash}</a></li>

A folder's full template shows its children with {node_view_gui content_node=$child view='line'}, so the line override is picked up wherever events are listed.

Click path or files

Template editor (click path)Files in your design extension
WhereDesign > Template Editoroverride/templates/ and settings/siteaccess/<site>/override.ini.append.php
Writesthe rule in the siteaccess's override.ini.append.php and the template filewhat you write
Good fortrying, one-off changesanything you keep: it is in Git and deploys with the extension
Orderdrag and dropthe order of the blocks, or Priority

The template editor's features (default copy, match by one object, remove that cleans up) are described in Template editor.

Order: which rule wins

When several rules match, the first wins. Rules with a Priority come before rules without one; among those, the lowest number first. Rules in extensions are ranked by extension order. Put specific rules (one node) before general ones (one class). Template editor: reorder, Extension loading order.

Checklist

  • To do: The template passes php bin/php/eztemplatecheck.php -s<site> <file>.
  • To do: After a new rule or file: --clear-id=template-override, --clear-tag=template and --clear-tag=content.
  • To do: Every user-typed value is printed with |wash.
  • To do: No inline <style> or <script> blocks: stylesheets and scripts go through the design's lists (Stylesheets and scripts for your site).
  • To do: With template path comments on, the page source shows your file for the page.

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