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

Override conditions: class, node, section, view mode and more

Every Match key an override can use - for full views, for node_view_gui lists and embeds, and for fields drawn with attribute_view_gui - taken from the kernel code that sets them, with examples and combination rules.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/extension-development/part-2-builder/override-conditions.md

On this page

Override conditions: class, node, section, view mode and more

Part 2, chapter 11. An override's Match[<key>] lines decide which content it applies to. This chapter lists every key, taken from the code that sets them: eZNodeviewfunctions::generateNodeViewData() in kernel/classes/eznodeviewfunctions.php for full views, and the forward rules in kernel/common/eztemplateautoload.php for node_view_gui and attribute_view_gui.

Keys for a node view (full view of a page, and node_view_gui)

KeyValueExampleUse for
class_identifierthe class identifierarticlethe look of a content type (the most used key)
classthe numeric class ID16the same, by ID (prefer identifiers: they survive reinstalls)
class_groupthe IDs of the class groups the class is in1every class of a group
nodethe node ID2one page, for example the front page
objectthe object ID1234one object, in every location
parent_nodethe parent's node ID59everything directly under one folder
parent_class_identifierthe parent's class identifierfolderchildren of a kind of container
parent_classthe parent's class ID1the same, by ID
sectionthe section ID1one section, by ID
section_identifierthe section identifierstandardone section (prefer this)
stateobject state IDs2content in a state, by ID
state_identifier<group>/<state> identifiersez_lock/lockedcontent in a state
depththe node's depth in the tree3one level of the tree
url_aliasthe node's URL aliasabout-usone page, by address
remote_idthe object's remote IDa1b2...one object, stable across installations
node_remote_idthe node's remote IDc3d4...one location, stable across installations
parent_node_remote_id, parent_object_remote_idthe parent's remote IDschildren of one place, stable across installations

A full view also knows viewmode (full, or the mode in the address), view_offset (the page offset of a paged view) and navigation_part_identifier (which menu part of the administration it belongs to).

Remote IDs are the right choice for rules that ship in an extension: node and object IDs differ between installations, remote IDs do not.

Keys for a field (attribute_view_gui and attribute_edit_gui)

{attribute_view_gui attribute=$node.data_map.image} draws a field with the template content/datatype/view/<datatype>.tpl. An override on that Source can match:

KeyValueExample
attribute_identifierthe class attribute's identifierimage
attributethe class attribute's ID245
class_identifierthe class identifier of the objectarticle
classthe class ID of the object16
[view_article_image]
Source=content/datatype/view/ezimage.tpl
MatchFile=datatype/view/article_image.tpl
Subdir=templates
Match[class_identifier]=article
Match[attribute_identifier]=image

Combining conditions

All Match lines of one block must be true:

[line_article_in_news]
Source=node/view/line.tpl
MatchFile=line/news_article.tpl
Subdir=templates
Match[class_identifier]=article
Match[parent_node]=59

There is no "or": write two blocks. For a value that is a list (class_group, state, state_identifier), the condition is met when the list contains the value.

Examples by task

The front page:

[full_frontpage]
Source=node/view/full.tpl
MatchFile=full/frontpage.tpl
Subdir=templates
Match[node]=2

Every article in list views:

[line_article]
Source=node/view/line.tpl
MatchFile=line/article.tpl
Subdir=templates
Match[class_identifier]=article

A section with its own look:

[full_folder_intranet]
Source=node/view/full.tpl
MatchFile=full/intranet_folder.tpl
Subdir=templates
Match[class_identifier]=folder
Match[section_identifier]=intranet

Override keys of other templates

Other templates set their own keys; the debug output's template table shows what each request offered. Embedded objects in rich text, for example, add keys for the embed's view and class (the media theme matches Match[classification] on embeds). When in doubt, search the code that renders the template for setKeys or attribute_keys:

grep -rn "setKeys\|'attribute_keys'" kernel/ | head

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