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

A design inside an extension

Templates, overrides, stylesheets, scripts and images an extension carries: which design folder to use, how to make them overridable, and how they reach the page.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/extension-development/part-3-extension-developer/design-in-an-extension.md

On this page

A design inside an extension

Part 3, chapter 22. Almost every extension has templates: the pages of its module, the views of its datatype, the admin screens. They live in a design/ folder of the extension, found through the design chain. This chapter is for extension authors; building a whole theme is Part 6.

Register the design folder

extension/mysite_hello/settings/design.ini.append.php:

<?php /* #?ini charset="utf-8"?

[ExtensionSettings]
DesignExtensions[]=mysite_hello

*/ ?>

Every extension/mysite_hello/design/<design>/ is then part of the design chain for siteaccesses that use <design> (The design chain).

Which design folder

Templates forPut them inWhy
your module's public pagesdesign/standard/templates/<module>/standard is at the end of every chain: they work under any site design, and a site design can override them
your datatypedesign/standard/templates/content/datatype/{edit,view}/ and class/datatype/{edit,view}/the same
your module's admin pagesdesign/admin/templates/<module>/ and design/admin4/templates/<module>/the admin designs; admin4 is the modern administration
overrides you ship as defaultsdesign/standard/override/templates/used by override rules in your settings

Do not put module or datatype templates into a site design (design/mysite/): they would disappear for every other site design.

Make them overridable

A site that installs your extension will want to change your HTML without editing your files. Help it:

  • Keep templates small and split them into includes ({include uri='design:hello/parts/item.tpl' item=$item}); a site can override one part instead of the whole page.
  • Name every template by what it is, under a folder named after your module.
  • Put no logic into templates that a site would have to copy when it overrides them; move it to operators or the view.
  • Document the templates and their variables in your README.

Stylesheets, scripts, images

They go in design/<design>/stylesheets/, javascript/ and images/ and are loaded through the design's settings and the ezjscore packer; see CSS and JavaScript in an extension. Templates never carry <style>, style="", inline <script> or on...= attributes: the administration enforces a Content Security Policy and refuses them (Content Security Policy for extension authors).

New template files and caches

A new template file is only found after the template override and design caches are cleared:

php bin/php/ezcache.php --clear-id=template-override,design_base

Without it a page can render with an empty content area. ./console exp:velocity deploy includes these clears.

Check it

Turn on ShowTemplatePathComments and open your page: the comments must name your extension's files. Then try a site override of one of them to see that it is overridable.

RAD

Design extension (/setup/designextension) writes a design with templates, stylesheets and an override set; the module wizards write their templates into standard and the admin designs.

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