Content Item (Article) Template Inheritance
Content item templates (or article templates) are all located under
the config.default.article
template. You can
create:
-
Specialized templates for specific content item types (for example
config.default.article.type.story
andconfig.default.article.type.picture
) -
Specialized templates for content items belonging to specific sections (for example
config.default.article.premierleague
orconfig.default.article.football
) -
Specialized templates for specific content item types belonging to specific sections (for example
config.default.article.premierleague.type.story
orconfig.default.article.premierleague.type.picture
)
Below is a description of how the template and area layouts are
selected for a story
content item in the
premierleague
section, assuming a section hierarchy
like this:
ece_frontpage
sports
football
premierleague
Template selection
To find the correct template, the Widget Framework first looks for an
article template of the correct type for the correct section. If there
is no such template, then it looks for an article template for the
correct section. If it still doesn't find a template then it repeats
these two steps for the parent section, (football
),
and so on up the section hierarchy:
-
config.default.article.premierleague.type.story
-
config.default.article.premierleague
-
config.default.article.football.type.story
-
config.default.article.football
-
config.default.article.sports.type.story
-
config.default.article.sports
-
config.default.article.ece_frontpage.type.story
-
config.default.article.ece_frontpage
-
config.default.article.type.story
-
config.default.article
-
config.default
Area layout selection
This section describes the Widget Framework's default
area layout selection mechanism, which is based on the
template hierarchy. In earlier versions of the Widget Framework,
however, area layout selection was based on the template naming
convention. You can force the current version of the Widget
Framework to use this old area layout selection mechanism by setting
the property wf.conventionalInheritance
to
true
in your publication
feature
resource.
The Widget Framework assembles content item layouts in the same way as
section page layouts. If, for example,
config.default.article.premierleague.type.story
only contains a layout for the Aside area, then
it will continue to search for the Meta, Outer, Header, Top,
Main, Bottom and Footer areas in the
config.default.article.premierleague
template.
If template hierarchy is like this:
config.default
config.default.article
config.default.article.type.story
config.default.article.type.picture
config.default.article.premierleague
config.default.article.premierleague.type.story
It will search the templates in the following order:
-
config.default.article.premierleague.type.story
-
config.default.article.premierleague
-
config.default.article
-
config.default
Section template hierarchy variations
Section template hierarchy variations such as a flatter structure or missing templates are handled in exactly the same way as for section templates (see Section Template Inheritance).