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 resolution: designs and overrides

How Exponential decides which template file renders a view - the design chain of a siteaccess, extension designs, the design: resource, override.ini rules matched by class, node, section or view mode - compared with…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/web-framework-developers/template-resolution-designs-and-overrides.md

On this page

Template resolution: designs and overrides

This page is for developers who know Twig's template paths and namespaces, Laravel's view paths and vendor overrides, or Django's template loaders. Exponential resolves a template name such as design:node/view/full.tpl in two steps: first through a design chain (a stack of directories), then through override rules that can swap the file depending on what is being rendered.

Contents

  1. The design chain
  2. Override rules
  3. Compared with other frameworks
  4. Where your templates go
  5. Finding out which file rendered

The design chain

A design is a directory of templates, stylesheets and images. A siteaccess names its designs in site.ini [DesignSettings]: SiteDesign, AdditionalSiteDesignList[] and StandardDesign (standard). Extensions add their design directories with design.ini [ExtensionSettings] DesignExtensions[]. eZTemplateDesignResource (kernel/common/eztemplatedesignresource.php) builds the chain, extension design directories first, then design/<design>/; the first directory that has the file wins (Design and override system, Designs and the fallback chain).

Override rules

override.ini (of the siteaccess and of every extension) has one group per rule:

[node/view/full#ng_article]
Source=node/view/full.tpl
MatchFile=node/view/full/full_ng_article.tpl
Subdir=templates
Match[class_identifier]=ng_article
Priority=1

When node/view/full.tpl is fetched for an object of the class ng_article, the file override/templates/node/view/full/full_ng_article.tpl of the design chain is used instead. The first rule whose conditions all match wins; rules are ordered by Priority (lower first) when one is given (Resources and overrides, Template override ordering).

Match keys are set by whoever renders: content/view sets the node's keys (class_identifier, node, parent_node, section, url_alias, depth, viewmode, state and more); node_view_gui sets them per item, so a list can render each child with its class's line template. A view of your own can add keys with eZTemplateDesignResource::instance()->setKeys().

Compared with other frameworks

Framework ideaExponential
Template paths searched in orderthe design chain
Bundle templates overridden in templates/bundles/<Bundle>/ (Symfony), resources/views/vendor/ (Laravel)the same file name in a design earlier in the chain
Theme inheritanceAdditionalSiteDesignList[] falling back to standard
Choosing a template per content type in a controlleran override rule matched on class_identifier
Template selection by a view resolver (Spring)the design resource with override rules
{% extends %} and blocksno equivalent; whole templates are overridden, shared parts are included

Where your templates go

TemplatesPlace
Your module's viewsextension/<ext>/design/standard/templates/<ext>/..., with DesignExtensions[]=<ext>
Overrides for a site's designextension/<site>/design/<design>/override/templates/... plus override.ini.append.php rules
Admin pagesthe admin designs, following the admin styling rules (admin4 styling)

Never edit design/standard/ or the kernel's admin designs: override instead, so updates do not overwrite you.

Finding out which file rendered

  • Template path comments print the file name around each template's output (Template path comments).
  • The debug bar lists the templates used on a page (Exp debug bar).
  • After adding a new template file, clear the template-override cache; otherwise the old resolution stays cached (Template caches).

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