Tag Template Inheritance

Tag pages are automatically generated pages created to display links and content related to tags. When a user clicks on a tag keyword link, the corresponding tag page is displayed. The tag page usually contains a brief article about or definition of the subject of the tag, followed by teasers and links leading to tagged content items. The layout of these tag pages can be defined using tag page templates.

Tag page templates are all located under the config.default.tag template. You can create:

  • Specialized templates for specific tag structures (for example config.default.tag.scheme.places and config.default.tag.scheme.sports)

  • Specialized templates for specific tags (for example config.default.tag.places.bangladesh or config.default.tag.sports.football)

Below is a description of how the template and area layouts are selected for a dhaka tag page, assuming a tag structure like this:

places (Tag structure)
  asia
    bangladesh
      dhaka
Template selection

To find the correct template, the Widget Framework first looks for a tag template for the specific tag (dhaka). If there is no such template, then it looks to see if the parent tag (bangladesh) has a template, and so on up the tag hierarchy. It will then check to see if there is a template for the tag structure (places), and if not it will continue up the template hierarchy to the root:

  1. config.default.tag.places.dhaka

  2. config.default.tag.places.bangladesh

  3. config.default.tag.places.asia

  4. config.default.tag.scheme.places

  5. config.default.tag

  6. config.default

Area layout selection

Just like in case of section and article, area layout selection for tag templates follows the default area layout selection mechanism, which is based on the template hierarchy.

The Widget Framework assembles tag page layouts in the same way as section page and content item layouts. If, for example, config.default.tag.places.dhaka 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.tag.places.bangladesh template.

For example, if template hierarchy is like this:

config.default
  config.default.tag
    config.default.tag.scheme.people
    config.default.tag.scheme.foods
    config.default.tag.scheme.places
      config.default.tag.places.asia
        config.default.tag.places.bangladesh
          config.default.tag.places.dhaka

then for the dhaka tag, it will search the templates for area layouts in the following order:

  1. config.default.tag.places.dhaka

  2. config.default.tag.places.bangladesh

  3. config.default.tag.places.asia

  4. config.default.tag.scheme.places

  5. config.default.tag

  6. config.default