Section Template Inheritance

There are two different section template inheritance mechanisms, one governing the selection of templates, and one governing the merging of the layout definitions in the sections. This section describes how they are used to display a section called premierleague in a section hierarchy like this:

ece_frontpage
  sports
    football
      premierleague

with a corresponding template hierarchy that looks like this:

config
  config.default.section
    config.default.section.sports
      config.default.section.football
        config.default.section.premierleague
Template selection

The Widget Framework first has to determine which template to select. In this case it is simple, since the premierleague section has its own template (config.default.section.premierleague). If there was no such template, however, then the Widget Framework would look for the template of its parent section (football), and so on upwards. The Widget Framework bases its search on the section hierarchy, looking for templates in the following order:

  1. config.default.section.premierleague

  2. config.default.section.football

  3. config.default.section.sports

  4. config.default.section

  5. config.default

Note that even though ece_frontpage is an ancestor of premierleague, its template is not included in the lookup sequence. ece_frontpage is a special case, and its template is never used for any other section.

Area layout selection

Once it has found a template (in this case config.default.section.premierleague) the Widget Framework then tries to assemble a complete template, containing a layout for each top-level area. In this case it bases its search on the template hierarchy rather than the section hierarchy. If, for example, config.default.section.premierleague 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.section.football template. It will search the templates in the following order, stopping once it has a complete set of layouts.

  1. config.default.section.premierleague

  2. config.default.section.football

  3. config.default.section.sports

  4. config.default.section

  5. config

With a flatter template hierarchy

The two search sequences described above are very similar because the template hierarchy closely matches the section hierarchy. This need not be the case, however. If the template hierarchy looked more like this:

config
  config.default.section
    config.default.section.sports
    config.default.section.football
    config.default.section.premierleague

then the template search sequence would be the same, but the layout search sequence would be:

  1. config.default.section.premierleague

  2. config.default.section

  3. config

With a missing template

If there was no premierleague template at all:

config
  config.default.section
    config.default.section.sports
    config.default.section.football

then the Widget Framework would start by using the template search sequence to select the football section's template, config.default.section.football, and would then search for layouts in the following sequence:

  1. config.default.section.football

  2. config.default.section

  3. config