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

Node templates by class

Organizing a design's templates per content class and view mode: the override rule pattern, a folder layout by view mode, a naming scheme, a checklist of the class and mode pairs a site needs, and how the media and…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/templates/node-templates-by-class.md

On this page

Node templates by class

This page is for designers who organize the view templates of a whole site. The usual pattern: one override rule and one template for each pair of content class and view mode that needs its own look.

Contents

  1. The pattern
  2. Folder layout and names
  3. Which pairs a site needs
  4. How the shipped designs do it

The pattern

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

[mytheme_line_article]
Source=node/view/line.tpl
MatchFile=line/article.tpl
Subdir=templates
Match[class_identifier]=article

Folder layout and names

design/mytheme/override/templates/
├── full/article.tpl      full/folder.tpl      full/event.tpl
├── line/article.tpl      line/event.tpl
├── card/article.tpl
└── embed/image.tpl       embed/video.tpl
  • Folder = view mode; file = class identifier.
  • Section names: <theme>_<mode>_<class>; unique across all settings files.
  • One rule per pair; no giant switch in a generic template (Switch and case).

Which pairs a site needs

Classfulllinecardembed
articleyesyesyes
folderyesyes
imageyes
...

Fill a table like this from the site's content model; every "yes" is one rule and one template. Classes without a rule use the default node/view/<mode>.tpl, so make the defaults decent.

How the shipped designs do it

  • The media design keeps its rules in settings/siteaccess/site/override.ini.append.php (and bold/) of its extension, with templates in override/templates/full/, line/, embed/, content/ and more.
  • The starter design keeps them in settings/siteaccess/cjw_starter/override.ini.append.php; each full/<class>.tpl includes content/full/<class>.tpl, so layout blocks can draw parts of the same content.
  • The super design shows the minimal case: one rule, full/article.tpl.

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