Template override conditions
This section contains an overview of the override conditions that can be used to override the system templates.
Override example
[magic_pockets] (1) Source=node/view/full.tpl (2) MatchFile=magic_pocket.tpl (3) Subdir=templates (4) Match[class_identifier]=pocket (5) Match[section]=34 (6) ... ...
- The name of the override.
- The template that should be overridden.
- The alternate template that should be used.
- The location of the override templates.
- Match condition #1
- Match condition #2
List of possible match conditions:
Condition | Description |
---|---|
class |
Matches the ID number of the class. |
object |
Matches the ID number of class group. |
class_identifier |
Matches the identifier of the class (for example "folder"). |
section |
Matches the number of the section in which the search was conducted. |
section_id |
Matches the number of the section which the object belongs to. |
section_identifier |
Matches the identifier of the section which the object belongs to. Available since eZ Publish 4.4. |
node |
Matches the ID number of the node. |
parent_node |
Matches the ID number of the parent node. |
view_offset |
Matches the offset view parameter. |
depth |
Matches the depth of the node. The depth of a top level node is 1. |
navigation_part_identifier |
Matches the identifier of the navigation part. |
url_alias |
Matches the virtual URL of the node. |
attribute_identifier |
Matches the identifier of the attribute. |
class_group |
Matches the ID number of the group that the class which the object is an instance of belongs to. |
remote_id |
Matches the remote ID number of the object. |
state |
Matches the content object state id. |
state_identifier |
Matches the content object state identifier. |
layout |
Matches the name of the layout (for example "print", "fullpage", etc.). |
viewmode |
Matches the name of the view mode (full, line, etc.) |
parent_class |
Matches the ID number of the parent class. |
parent_class_identifier |
Matches the identifier of the parent class. |
persistent_variable |
Matches the value of the persistent variable if the "view" view of the "content" module was executed. (The persistent variable should be set in the "node/view/<view_mode>.tpl" template that was used by this view.) |
error_number |
Matches kernel errors. Note that some kind of errors, i.e. database errors, may prevent the overriding. |
workflow |
Matches the ID number of the workflow. |
workflowgroup |
Matches the ID number of the workflow group. |
Please find below a list of examples of match conditions.
class/edit.tpl
Condition | Description |
---|---|
class |
Matches the ID number of the class. |
class/groupedit.tpl
Module/view: class / groupedit
Condition | Description |
---|---|
object |
Matches the ID number of class group. |
class/view.tpl
Condition | Description |
---|---|
class |
Matches the ID number of the class. |
class_identifier |
Matches the identifier of the class (for example "folder"). |
content/advancedsearch.tpl
Module/view: content / advancedsearch
Condition | Description |
---|---|
section |
Matches the number of the section in which the search was conducted. |
section_identifier |
Matches the identifier of the section which the object belongs to. Available since eZ Publish 4.4. |
content/browse.tpl
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
node |
Matches the ID number of the node. |
parent_node |
Matches the ID number of the parent node. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
view_offset |
Matches the offset view parameter. |
depth |
Matches the depth of the node. The depth of a top level node is 1. |
navigation_part_identifier |
Matches the identifier of the navigation part. |
url_alias |
Matches the virtual URL of the node. |
content/collectedinfo/*.tpl
Module/view: content / collectinformation
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
node |
Matches the ID number of the node. |
parent_node |
Matches the ID number of the parent node. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
depth |
Matches the depth of the node. The depth of a top level node is 1. |
navigation_part_identifier |
Matches the identifier of the navigation part. |
url_alias |
Matches the virtual URL of the node. |
content/collectedinfo/*.tpl
Module/view: content / collectedinfo
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
node |
Matches the ID number of the node. |
parent_node |
Matches the ID number of the parent node. |
class |
Matches the ID number of the class which the object is an instance of. |
depth |
Matches the depth of the node. The depth of a top level node is 1. |
navigation_part_identifier |
Matches the identifier of the navigation part. |
url_alias |
Matches the virtual URL of the node. |
content/collectedinfomail/*.tpl
Module/view: content / collectinformation
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
node |
Matches the ID number of the node. |
parent_node |
Matches the ID number of the parent node. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
depth |
Matches the depth of the node. The depth of a top level node is 1. |
navigation_part_identifier |
Matches the identifier of the navigation part. |
url_alias |
Matches the virtual URL of the node. |
content/datatype/edit/*.tpl
Module/view: none.
Condition | Description |
---|---|
class_identifier |
Matches the identifier of the class. |
attribute_identifier |
Matches the identifier of the attribute. |
content/datatype/view/*.tpl
Module/view: none.
Condition | Description |
---|---|
class_identifier |
Matches the identifier of the class. |
attribute_identifier |
Matches the identifier of the attribute. |
content/edit.tpl
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
section |
Matches the number of the section which the object belongs to. |
section_identifier |
Matches the identifier of the section which the object belongs to. Available since eZ Publish 4.4. |
class_group |
Matches the ID number of the group that the class which the object is an instance of belongs to. |
content/history.tpl
Module/view: content / history
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
section |
Matches the number of the section which the object belongs to. |
section_identifier |
Matches the identifier of the section which the object belongs to. Available since eZ Publish 4.4. |
content/queued.tpl
Module/view: none.
Condition | Description |
---|---|
object |
Matches the content ID number of the object. |
remote_id |
Matches the remote ID number of the object. |
class |
Matches the ID number of the content class which the object is an instance of. |
class_identifier |
Matches the identifier of the content class which the object is an instance of. |
class_group |
Matches the identifier of the class group which the content class is an instance of. |
state |
Matches the content object state id. |
state_identifier |
Matches the content object state identifier. |
section |
Matches the section ID. |
section_identifier |
Matches the section identifier |
content/search.tpl
Condition | Description |
---|---|
section |
Matches the number of the section in which the search was conducted. |
section_identifier |
Matches the identifier of the section which the object belongs to. Available since eZ Publish 4.4 |
content/tipafriend.tpl
Module/view: content / tipafriend
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
class_group |
Matches the ID number of the group that the class which the object is an instance of belongs to. |
section |
Matches the number of the section which the object belongs to. |
section_identifier |
Matches the identifier of the section which the object belongs to. Available since eZ Publish 4.4. |
node |
Matches the ID number of the node. |
parent_node |
Matches the ID number of the parent node. |
depth |
Matches the depth of the node. The depth of a top level node is 1. |
url_alias |
Matches the virtual URL of the node. |
content/tipafriendmail.tpl
Module/view: none.
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
class_group |
Matches the ID number of the group that the class which the object is an instance of belongs to. |
section |
Matches the number of the section which the object belongs to. |
section_identifier |
Matches the identifier of the section which the object belongs to. Available since eZ Publish 4.4. |
node |
Matches the ID number of the node. |
parent_node |
Matches the ID number of the parent node. |
depth |
Matches the depth of the node. The depth of a top level node is 1. |
url_alias |
Matches the virtual URL of the node. |
content/versions.tpl
Module/view: content / versions
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
section_id |
Matches the number of the section which the object belongs to. |
content/versionview.tpl
Module/view: content / versionview
Condition | Description |
---|---|
navigation_part_identifier |
Matches the identifier of the navigation part. |
content/view/*.tpl
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
section |
Matches the number of the section which the object belongs to. |
section_identifier |
Matches the identifier of the section which the object belongs to. Available since eZ Publish 4.4. |
class_group |
Matches the ID number of the group that the class which the object is an instance of belongs to. |
layout/set.tpl
Condition | Description |
---|---|
layout |
Matches the name of the layout (for example "print", "fullpage", etc.). |
node/view/*.tpl
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
node |
Matches the ID number of the node. |
parent_node |
Matches the ID number of the parent node. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
view_offset |
Matches the offset view parameter. |
depth |
Matches the depth of the node. The depth of a top level node is 1. |
section |
Matches the number of the section which the object belongs to. |
section_identifier |
Matches the identifier of the section which the object belongs to. Available since eZ Publish 4.4. |
navigation_part_identifier |
Matches the identifier of the navigation part. |
viewmode |
Matches the name of the view mode (full, line, etc.) |
url_alias |
Matches the virtual URL of the node. |
class_group |
Matches the ID number of the group that the class which the object is an instance of belongs to. |
parent_class |
Matches the ID number of the parent class. |
parent_class_identifier |
Matches the identifier of the parent class. |
node/view/pdf.tpl
Condition | Description |
---|---|
object |
Matches the ID number of the object. |
node |
Matches the ID number of the node. |
parent_node |
Matches the ID number of the parent node. |
class |
Matches the ID number of the class which the object is an instance of. |
class_identifier |
Matches the identifier of the class which the object is an instance of. |
depth |
Matches the depth of the node. The depth of a top level node is 1. |
url_alias |
Matches the virtual URL of the node. |
class_group |
Matches the ID number of the group that the class which the object is an instance of belongs to. |
pagelayout.tpl
Module/view: none.
Condition | Description |
---|---|
persistent_variable |
Matches the value of the persistent variable if the "view" view of the "content" module was executed. (The persistent variable should be set in the "node/view/<view_mode>.tpl" template that was used by this view.) |
error_number |
Matches kernel errors. Note that some kind of errors, i.e. database errors, may prevent the overriding. |
[any] |
The pagelayout may be overridden using the same keys that are available for the view which was used within the request. For example, if the "view" view of the "content" module was accessed, then the override conditions of that view will be matched. This makes it possible to create a pagelayout override that will be triggered when, for example, nodes referencing objects that belong to a certain section are requested. |
workflow/edit.tpl
Condition | Description |
---|---|
workflow |
Matches the ID number of the workflow. |
workflow/groupedit.tpl
Module/view: workflow / groupedit
Condition | Description |
---|---|
workflowgroup |
Matches the ID number of the workflow group. |
workflow/view.tpl
Condition | Description |
---|---|
workflow |
Matches the ID number of the workflow. |
Balazs Halasy (09/03/2005 8:41 am)
Andrea Melo (05/12/2012 4:56 pm)
Comments
OR conditions
Thursday 13 October 2005 8:54:10 am
Tristan Rivoallan
Re: OR conditions
Thursday 13 October 2005 1:10:30 pm
Jan Kudlicka
[magic_pockets_43]
Source=node/view/full.tpl
MatchFile=magic_pocket.tpl
Subdir=templates
Match[node]=43
[magic_pockets_56]
Source=node/view/full.tpl
MatchFile=magic_pocket.tpl
Subdir=templates
Match[node]=56
(Note that the group name must be diffent.)
If you have set of many such nodes, you may consider creating a special class for those nodes or place them in special section (do not forget on permission settings in this case).
Override a pagelayout_bodycontent
Tuesday 18 April 2006 2:21:55 pm
Nguyen Tien Hy
"--------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$site.http_equiv.Content-language|wash}" lang="{$site.http_equiv.Content-language|wash}">
<head>
{include uri="design:pagelayout_style.tpl"}
{include uri="design:pagelayout_javascript.tpl"}
{literal}
<!--[if lt IE 6.0]>
<style>
div#maincontent-design { width: 100%; } /* This is needed to avoid width bug in IE 5.5 */
</style>
<![endif]-->
{/literal}
{include uri="design:page_head.tpl"}
</head>
<body>
<div id="allcontent">
<div id="topcontent">
{include uri="design:pagelayout_topcontent.tpl"}
</div>{* id="topcontent" *}
<hr class="hide" />
{include uri="design:pagelayout_topmenu.tpl"}
<hr class="hide" />
{include uri="design:pagelayout_path.tpl"}
{include uri="design:pagelayout_bodycontent.tpl"}
<hr class="hide" />
{include uri="design:pagelayout_toolbarbottom.tpl"}
{include uri="design:pagelayout_footer.tpl"}
<div class="break"></div>
</div>{* id="allcontent" *}
<!--DEBUG_REPORT-->
</body>
</html>
-------"
I "override" pagelayout_bodycontent.tpl as follows:
1. Put a new template in "frontpage/pagelayout_bodycontent.tpl".
2. Write into override.ini.append.php
[pagelayout_bodycontent_frontpage]
Source=pagelayout_bodycontent.tpl
MatchFile=frontpage/pagelayout_bodycontent.tpl
Subdir=templates
Match[node]=2
But the result is not OK. The override pagelayout_bodycontent.tpl not run.
Re: Override a pagelayout_bodycontent
Wednesday 10 October 2007 4:15:27 pm
André R.
match condition on url_alias
Monday 12 June 2006 2:43:10 pm
Xavier Gouley (Smile)
Just to mention that match on url_alias is recursive.
Match[url_alias]=my_folder
will override not only my_folder content, but also all its children
(tried with pagelayout override).
It's a good idea, to avoid use of section, but it's not really told in the doc.
Re: match condition on url_alias
Saturday 20 October 2007 3:08:57 pm
André R.
note on persistent_variable as override
Saturday 20 October 2007 3:06:44 pm
André R.
Basicly you can have something like this in a node template:
And then have a override rule for your page layout like this:
the template layout/set.tpl is nowhere to be found
Wednesday 27 February 2008 11:22:30 pm
Gaetano
node_view_gui and parent_class_identifier
Wednesday 09 July 2008 8:36:25 am
Jérôme Cohonner
In fact, the parent_class_identifier used is the parent class of the currently node (in view full) that includes the node_view_gui call.
Fell free to have a look at this issue for more information and for a patch : http://issues.ez.no/IssueView.php?Id=11499&activeItem=1
A similar problems occurs with attribute_view_gui and class_identifier. A patch is included within the issue tracker.
Jérôme Cohonner - Cosmosbay ~ Vectis
Re: node_view_gui and parent_class_identifier
Wednesday 09 July 2008 10:50:09 am
Kristof Coomans
The issue with class_identifier override condition for attribute_view_gui template function was already fixed for next subreleases (4.0.1, 3.10.1, 3.9.5), see http://issues.ez.no/11898. We'll try to have a look at the other issue in the near future.
content/browse.tpl
Sunday 06 December 2009 10:11:39 am
Christoph von Siebenthal
Match[class_id]=agenda_stage instead of class_identifier
I lost 45 minutes on it!
Override pagelayout.tpl by Subtree
Wednesday 06 January 2010 3:09:58 pm
Mauicio Sánchez
You can achieve such functionality using an override by section or url_alias instead by subtree, but it's kinda clunky approach, because the section adds a lot more functionality for the content that you don't want to deal with, and the url_alias can change with the content edition.
Notice to use Match[class_group] in override.ini
Wednesday 13 January 2010 9:34:51 am
Sébastien Leguevaques
[ContentOverrideSettings]
EnableClassGroupOverride=true
pagelayout.tpl [any] override
Wednesday 16 June 2010 3:02:31 pm
Marco Rogers
How do you override the pagelayout of /notification/settings?
Friday 02 July 2010 8:23:55 pm
Benxamin
The template path is
/design/ezwebin/templates/notification/handler/ezsubtree/settings/edit.tpl
What is the override match condition for /notification/settings? They are not content nodes...
Override content/view/embed.tpl by classification
Wednesday 14 July 2010 1:40:56 pm
Sander van den Akker
Classifications can be defined in content.ini and are set in the insert object dialog of the online editor. This allows for example, automatic lists of subitems of an object, highlighted objects etc.