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

Override by section

Giving an area of the site its own templates with sections: section_identifier (portable) versus section id, combining with class rules, a section-specific stylesheet, and section classes on the body from the pagelayout.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/templates/override-by-section.md

On this page

Override by section

This page is for designers who give an area of the site (a members area, a press room, a campaign) its own look. Sections group content across the tree; editors assign them.

Contents

  1. The rule
  2. Combining with classes
  3. Styling by section without overrides

The rule

[mytheme_full_press_article]
Source=node/view/full.tpl
MatchFile=full/press_article.tpl
Subdir=templates
Match[section_identifier]=press
Match[class_identifier]=article
Priority=10

Use section_identifier (set when the section is created) rather than section (its id), which differs between installations.

Combining with classes

A section rule alone replaces the template for every class in the section, folders and images included. Usually combine it with class_identifier, and give it a lower Priority than the plain class rule so it is checked first.

Styling by section without overrides

Often only colors or a header differ. Then no override is needed: the pagelayout reads the section from $module_result.content_info and sets a class:

{def $section_class = ''}
{if and( is_array( $module_result.content_info ), is_set( $module_result.content_info.section_identifier ) )}
    {set $section_class = concat( 'section-', $module_result.content_info.section_identifier )}
{/if}
<body class="{$section_class|wash}">

and the stylesheet does the rest (.section-press { --site-accent: ... }). The ezwebin design's page data adds a section_id_<n> class to its page wrapper the same way.

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