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 and config.default.article.type.picture)

  • Specialized templates for content items belonging to specific sections (for example config.default.article.premierleague or config.default.article.football)

  • Specialized templates for specific content item types belonging to specific sections (for example config.default.article.premierleague.type.story or config.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:

  1. config.default.article.premierleague.type.story

  2. config.default.article.premierleague

  3. config.default.article.football.type.story

  4. config.default.article.football

  5. config.default.article.sports.type.story

  6. config.default.article.sports

  7. config.default.article.ece_frontpage.type.story

  8. config.default.article.ece_frontpage

  9. config.default.article.type.story

  10. config.default.article

  11. 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:

  1. config.default.article.premierleague.type.story

  2. config.default.article.premierleague

  3. config.default.article

  4. 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).