Naming Templates

How you name templates is very important, since it determines how they are used and the hierarchical relationships between them. The following names may be used:

config

The config template is the root template and is used for all pages, both section pages and article pages.

config.section

The config.section template is the root section template and is used for all section pages. It is a child of the config template.

config.article

The config.article template is the root content template and is used for all content pages. It is a child of the config template.

config.topic

The config.topic template is the root content template and is used for all topic pages. It is a child of the config template.

config.section.section-name

There can be many such templates, where section-name is the unique name of a particular section in the publication. The template will then be used for this particular section. It is a child of the config.section template.

config.article.type.type-name

There can be many such templates, where type-name is the name of one of the publication's content types. The template will then be used for content items of this particular type. It is a child of the config.article template.

config.article.section-name

There can be many such templates, where section-name is the unique name of a particular section in the publication. The template will then be used for content items belonging to this particular section. It is a child of the config.article template.

config.article.section-name.type.type-name

There can be many such templates, where section-name is the unique name of a particular section in the publication and type-name is the name of one of the publication's content types. The template will then be used for type-name content items belonging to the section called section-name. It is a child of the config.article template.

config.topic.section-name

There can be many such templates, where section-name is the unique name of a particular section in the publication. The template will then be used for this particular topic belonging to this particular section. It is a child of the config.topic template.

config.master.master-template-name

There can be many such templates, each defining a master template. A master template contains a template fragment that can be re-used in other templates. You can give a master template any name you choose. For more detailed information about master templates, see Master Templates.

This means that the layout of a section called news, for example, will be based on the layouts in the templates config, config.section and config.section.news (if it exists). Similarly, the layout of a content item belonging to the content type story will be based on the layouts in the templates config, config.article and config.article.type.story (if it exists). If there is a template called config.article.news.type.story, then any story content items belonging to the news section will use this template instead of config.article.type.story.

The layouts in the various templates affecting a particular section or content item are combined by inheritance. When composing the news section, for example, layouts in config.section.news will override layouts in config.section, which will in turn override layouts in config. For more about the details of how template inheritance works, see Inheritance in Widget Framework.