Skip to the content
Documentation

Templates

No ratings yet

This chapter explains how Exponential 6 turns content into pages: the template files, the template language, the designs a siteaccess uses and the order in which they are searched, the override rules that pick a template for a class, a node or a section, the pagelayout, caching inside templates, the three template engines, and the tools for editing and debugging templates. It is written for site builders and template developers and describes Exponential 6.0.15.

Read in this order

  1. How templates work: what a template is, how a request becomes a page, node templates and system templates.
  2. The template language: syntax, variables, control structures, functions and operators.
  3. Designs and design order: SiteDesign, AdditionalSiteDesignList, designs in extensions, and where a template is looked for.
  4. The template override system: override rules in override.ini, the match conditions and their order.
  5. The pagelayout: the main template, its variables and the page head.
  6. Basic template tasks: includes, links and design files, view parameters.
  7. Information extraction: fetch functions, and printing node and object data.
  8. Template caching and cache-block: the compiled templates, the view cache and cache blocks.
  9. Template security and wash: escaping output.
  10. Template engines: .tpl, Smarty and Twig: the three engines of 6.0.15 and the converters between them.
  11. The Template Editor: overrides and template files from the Design tab of the administration interface.
  12. Debugging templates: the Exp Debug bar, the list of used templates, template path comments and the syntax check.

Reference

The reference pages are generated from the kernel, so they list exactly what your installation has. Use them instead of copying parameter lists into your notes:

History

The template language comes from eZ Publish, the system Exponential continues; its repository history starts in 2002, and def, if and foreach replaced the older let and section in version 3.6 (2005). The older style still runs: the standard page_head.tpl of 6.0.15 uses let and section to this day. The full story is in the history of the template language. What Exponential added is listed on the pages above, notably the Smarty and Twig engines, override priorities, the Exp Debug bar and template path comments. The comments readers left on the earlier pages are kept below the pages they were written on, marked as historical.

In this section

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.