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

Project 3: a template override

Study project 3 - find the design of your public siteaccess, see which template renders a page, make an override for one content class with the template editor and then as files with an override.ini rule, write the…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/students/project-03-a-template-override.md

On this page

Project 3: a template override

In this project you change how one kind of content looks on the site, without touching any file you do not own. You do it twice: once with the template editor in the administration, once as files you keep in Git. The steps follow Templates and design.

Contents

  1. At a glance
  2. Goal
  3. Before you start
  4. Tasks
  5. Hand in
  6. Rubric
  7. Stretch goals

At a glance

LevelIntermediate
TimeAbout 3 hours
PathsDeveloper, designer
PrerequisitesA terminal on your study site; Learning the template language; project 1 is useful

Goal

A full view for one content class (your "Club event" from project 1, or Article) that shows the title, one or more attributes and a list of the item's siblings, applied only to that class, kept as files in your own Git repository.

Before you start

Read Templates and design, parts 1 to 6, and Understanding siteaccesses and settings.

Tasks

  1. Find your design. Run php bin/php/console exp:ini where site/DesignSettings/SiteDesign site (use the siteaccess of the page you look at). Note the design name from the In effect: line (Templates and design).
  2. See which template answers. Switch on the template path comments for your public siteaccess, clear the template cache, open an item of your class, and search the page source for START (Templates and design). Note the template that renders the full view.
  3. Click path. In Design > Template Editor, open node/view/full.tpl of your design, press New override, choose Default copy, enter the object ID of one item, and Create. Add a visible line, save, reload the item. Then remove the override again with Remove selected (Templates and design).
  4. File path. Create the template in the override directory of your design, or better, in a design extension of your own (Learning path: designer, step 7). Write an override rule in override.ini.append.php with Source=node/view/full.tpl, your MatchFile, Subdir=templates, and Match[class_identifier]=<your class identifier> instead of a single object.
  5. Write the template. Show the title with {$node.name|wash}, at least one attribute with attribute_view_gui, and the list of siblings from the guide's example. Every printed value is escaped.
  6. Check the syntax: php bin/php/eztemplatecheck.php -s<siteaccess> <your file> --allow-root-user. Expected: Template file valid: <your file> (Templates and design).
  7. Clear the caches once for the new template path (template-override, the template tag and the content tag, as in the guide), and reload two items of your class and one item of another class. Only your class should change.
  8. Switch the path comments off again and clear the template cache. They add markup to every template and must never stay on.
  9. Commit the template and the rule to your own repository.

Hand in

  • The template file and the override rule.
  • Screenshots: the page source with the START ... (node/view/full.tpl) comment of your file; two items of your class and one of another class.
  • The output of the syntax check.
  • A short report: why you matched by class and not by object, and what each line of the template does.

Rubric

Score the four common criteria of Grading your own work, and these checks (8):

  1. The design name was found with exp:ini where, not guessed.
  2. No file in design/standard/ was changed.
  3. The override applies to the whole class and only to it.
  4. Every printed value uses wash or a view function.
  5. The syntax check passes.
  6. The path comments are switched off at the end.
  7. The files are in the learner's own Git repository, without settings/override/ secrets.
  8. The report explains Source, MatchFile, Subdir and Match.

Stretch goals

  • Add a line view override for the same class and use it in a list with node_view_gui ... view='line'.
  • Order two matching overrides with Priority and explain which wins (Template editor).
  • Read Template resources and overrides and draw the resolution of your template.

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