This article covers a Hippo CMS version 7.7. There's an updated version available that covers our most recent release.

HST Component Configuration Inheritance 

The HST-2 has multi-site, multi-channel and multi-lingual support out-of-the-box. This is achieved by being able to configure as many hosts, mounts and different hst:configurations as needed. Because for many (sub)sites, hst:configuration has many overlapping parts, hst:configuration can be inherited between sites. For example, an English and French version of my website can most likely share a lot of their hst:pages, hst:components and hst:templates. What they might not share is for example their hst:sitemenu and hst:sitemap: For example for the French website, you also want French URLs. So, the hst:configurations in this case without inheritance could look something like:

 

Now, suppose the templates, components, pages, and catalog would be the same for both English and French site. Then, the following configuration shows a setup with inheritance:

Now, all common parts have moved to common, and the specific parts are below now-fr and now-en. The inheritance is done by adding a property hst:inheritsfrom on now-fr and now-en. This property is a multi-valued property. The inheritance is in order of the top one first. In the case above, the value would be: hst:inheritsfrom = ../common The inheritance works also if for example now-en would also have some of its own hst:pages. If it has the same child node below hst:pages, than the inherited one is ignored. Now we also get to the hst:default : This is the implicit inherited configuration. It is always inherited by all configurations. It is typically the location where dependencies outside the scope of the current project can bootstrap their configuration to. For example some forge projects.
The exact inheritance rules are as follows. If we have the (sub)site now-en:

- hst:configurations (hst:configurations)
   |-now-en (hst:configuration) (hst:inheritsfrom = ../common)
   |    `-hst:pages
   |        `-a
   `-common (hst:configuration)
         `-hst:pages
            |-a
            |  `-child_of_a
            `-b

Then

  • now-en/hst:pages does not hide common/hst:pages

  • now-en/hst:pages/a does hide common/hst:pages/a (thus the child child_of_a is not inherited)
    The above thus for the now-en configuration results in:

// with inheritance resolved
now-en (hst:configuration) (hst:inheritsfrom = ../common)
   `-hst:pages
       |-a
       `-b

Because we will also have a hst:default (which has lowest precedence but is inherited implicitly), we will have the following total behavior:
if our configuration is:

- hst:configurations (hst:configurations)
    |-now-en (hst:configuration) (hst:inheritsfrom = ../common)
    |    `-hst:pages
    |       `-a
    |-common (hst:configuration)
    |   `-hst:pages
    |         |-a
    |         |  `-child_of_a
    |         `-b
    ` hstdefault (hst:configuration)
        `-hst:pages
            |-b
            |  `-child_of_b
            `-c
               `-child_of_c

Then, the now-en configuration with its inheritance resolved will become

// with inheritance resolved
- now-en (hst:configuration) (hst:inheritsfrom = ../common)
       `-hst:pages
           |-a // from now-en self: it does not inherit config below 'a' from common!
           |-b // from common: it does not inherit config below 'b' from hstdefault!
           `-c // from hstdefault
              `-child_of_c