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
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=10Use 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.
Related pages
- Override match keys
- Pagelayout variables
- 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.