Your own design extension
The template way of building starts with an extension of your own. It holds your templates, settings and stylesheets,
lives in its own git repository, and changes the site without editing the theme (sevenx_themes_media) or the
Layouts extensions, so their updates never overwrite your work. These pages call it mysite.
Contents
The files
extension/mysite/
settings/
design.ini.append.php registers the design extension
menu.ini.append.php, explayouts.ini.append.php ... your settings
design/
media/ the design the site uses (SiteDesign of the siteaccess)
templates/ same paths as the templates you replace
stylesheets/ your CSSsettings/design.ini.append.php:
[ExtensionSettings]
DesignExtensions[]=mysite
*/ ?>The folder under design/ must be the design the siteaccess uses: media for the Fit & Healthy site. Templates in
design/standard/ would be found for every design, after the site's own design.
Activate it, in the right place
Add mysite to [ExtensionSettings] ActiveExtensions[] of site.ini (Setup > Ini settings, or
./console exp:ini add site.ini/ExtensionSettings/ActiveExtensions[] mysite global). The position matters. What
was measured on the test copy:
mysite in ActiveExtensions[] | DesignExtensions[] in effect | Result |
|---|---|---|
appended at the end (what exp:ini add does) | mysite listed before sevenx_themes_media | the theme's templates win; the override is ignored |
placed before sevenx_themes_media | mysite listed after the theme | your templates win |
| placed first | mysite listed last | your templates win |
The rule behind it: the extensions are read in the reverse order of ActiveExtensions[], and in
DesignExtensions[] the last one listed wins. So an extension listed earlier in ActiveExtensions[] wins over
the ones after it. exp:ini add appends; to put the line first, edit the list in Setup > Ini settings (one
=name per line, in order) or in the file.
Override a template
Copy the template you want to change from the theme to the same path in your extension, then change your copy. For the header menu, for example:
extension/sevenx_themes_media/design/media/templates/pagelayout/header/main_menu.tpl (the theme's)
extension/mysite/design/media/templates/pagelayout/header/main_menu.tpl (yours, wins)The same works for every block template of Layouts, for example
extension/mysite/design/media/templates/explayouts/block/list/grid.tpl replaces the List block's grid view
(How a block maps to its templates).
Clear the caches
A new template file needs the override list rebuilt: clear Template & content
(./console exp:cache clear --tag=template,content). After changing ActiveExtensions[], clear the INI caches too
(--tag=template,content,ini).
Check which file is used
./console exp:ini get design.ini/ExtensionSettings/DesignExtensions -s site # mysite must come after the themeIn the page's HTML your markup shows. The administration's Quick settings (right column) have List of used templates and Template debug for a closer look.
Related pages
- A header menu that follows the tree
- Add a view type
- Add a block type
- Your own template blocks
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
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.