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

Two ways to build

Exponential 6.0.15+ builds pages two ways - template code in a design extension, and the Layouts editor with no code - and the two meet in blocks and template blocks. What each way is, who uses it, when to choose which…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/build-two-ways/two-ways-to-build.md

On this page

Two ways to build

Exponential 6.0.15+ gives a site two ways of being built, and most real sites use both at once.

1. Templates in a design extension2. The Layouts editor
What you make.tpl files, stylesheets, settings, in your own extensionLayouts: zones filled with blocks, stored in the database
Toolan editor, a terminal, gitthe administration's Layouts tab (in the top menu, or under More when the menu has no room for it)
Whodesigners, developerswebsite creators, editors, administrators
Changes go liveafter deploy and a cache clearwhen you press Publish layout
Versionedin git with your extensiondrafts and published versions in the database; export and import as .zip (exp:layouts)
Reacheverything: markup, data, logicwhat the block types and their view types offer

Contents

  1. Way 1: templates in a design extension
  2. Way 2: the Layouts editor
  3. Where the two meet
  4. A third tool: settings
  5. Which way when
  6. What it costs, measured

Way 1: templates in a design extension

A design is a folder of templates under extension/<name>/design/<design>/templates/. The Fit & Healthy site is the design media of the extension sevenx_themes_media. Every part of a page is a template there: pagelayout.tpl (the HTML page), pagelayout/header.tpl, pagelayout/footer.tpl, the content views under content/views/, the block templates under explayouts/block/.

A template that another extension provides is changed without touching it: put a file with the same path in your own design extension, listed later in design.ini [ExtensionSettings] DesignExtensions[] (the last one listed wins), and clear the template caches. Templates use Exponential's template language: {def}, {foreach}, fetch(), ezini(), |wash, |ezurl.

Choose it for anything structural: the HTML of the page, a new kind of block, a view of a content class, a menu that fetches its items, markup that must be the same on every page.

Way 2: the Layouts editor

Layouts in the administration builds pages from blocks, by drag and drop. The Layouts tab of the top menu (under More when the menu has no room for it) opens the Layouts dashboard; its left menu has Layout mappings, Layouts, Shared layouts, Components, Export, Import and Template editor, and New layout on the dashboard opens the editor. A layout has a type (its zones: for example header, post_header, main, pre_footer, footer) and holds blocks in its zones. The editor offers the block types defined in explayouts.ini (Title, Text, Rich text, Image, Button / Link, List, Grid, Gallery, Slider, Hero, Card, Two columns, Three columns, Four columns and more), each with its view types and options. Layout mappings decide which layout a page gets: by node, subtree, path or route, narrowed if needed by conditions such as the content class, the siteaccess or a time span.

Choose it for page composition: landing pages, campaign pages, a hero and three teasers, a list of the newest articles, the blocks above the footer, anything an editor should be able to rearrange without a release.

Where the two meet

The two ways are one system:

  • Every block is rendered by a template: design:explayouts/block/<block type>.tpl in the design. Change that template in your extension and every block of that type changes, everywhere.
  • A Template block is a block whose content is a template you name. That is how the shared layout Header / Footer puts the theme's header and footer into every layout: the layout decides where, the template decides what (How the header is built).
  • Shared layouts with linked zones let one set of blocks appear on many page types (Shared layouts and zone linking).
  • The templates read content with fetch(), the blocks read it through collections (hand-picked items or a query on the tree). Both show the same content tree.

A third tool: settings

Some things are neither: the header menu of this theme is a list of node IDs in menu.ini, read by the header template. Settings are changed in Setup > Ini settings (the group System of the Setup menu) or with ./console exp:ini, no code (Add a header menu item).

Three things of the administration come up on almost every page of this guide:

  • The right column has the Clear cache box (choose, for example, Template & content, then Clear) and, further down, Quick settings for the debug switches such as List of used templates, with a Siteaccess choice and Set. The address setup/settingstoolbar of the administration shows the same switches as a page of its own, Quick settings.
  • Content is added in Content structure (or Media for the footer links): open the parent and press Create new above its sub items; the menu lists the classes by group (Netgen holds Landing page and Menu item, Content holds Folder).
  • The ? button in the top bar has Help for this page and Open the Help center, where this guide and the rest of the help can be searched.

Which way when

The full table is on Which way: the decision table. In short:

If the change isUse
Where blocks are and which onesLayouts editor
What a block type looks like everywhereTemplate override of explayouts/block/<type>.tpl
The site's chrome (header, footer, page HTML)Templates; place it with a template block
The header or footer menu entries of this themeSettings (menu.ini) or, for the footer's second line, content
A new kind of blockBoth: a block definition in explayouts.ini plus its template, then the editor offers it

What it costs, measured

On a throwaway copy of the installation (PHP's built-in server, a shared host under load):

TaskWayStepsTime measured
Add a header menu itemAdministration (settings)10 actions
Add a header menu itemConsole2 commands1.3 to 2.1 s + 2.0 to 2.5 s
Add a footer linkContent tree9 actions, no cache clear
First page after a full template and content clear2.9 to 3.4 s
A page from the page cache22 to 102 ms

How these were counted: Measured steps and times.

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