HST Configuration Inheritance
Note:
hst:workspacenodes are only inherited when explicitly configured. See the Workspace inheritance section for details.
Bloomreach Content supports multi-site, multi-channel, and multi-language configurations. You can define multiple hosts, mounts, and hst:configurations to support different (sub)sites. Many configurations share common elements, so HST allows configuration inheritance to avoid duplication.
For example, English and French versions of a website often share hst:abstractpages, hst:components, and hst:templates. However, they may require separate hst:sitemenu and hst:sitemap nodes, as URLs and navigation differ by language.
A configuration without inheritance might look like the following:
/hst:hst: /hst:configurations: /hst:default: /myproject: /hst:abstractpage: /hst:catalog: /hst:components: /hst:pages: /hst:prototypepages: /hst:sitemap: /hst:templates: /hst:workspace: /hst:channel: /hst:pages: /hst:sitemap: /hst:sitemenus: /hst:containers: /monproject: /hst:abstractpage: /hst:catalog: /hst:components: /hst:pages: /hst:prototypepages: /hst:sitemap: /hst:templates: /hst:workspace: /hst:channel: /hst:pages: /hst:sitemap: /hst:sitemenus: /hst:container:
If the abstractpages, catalog items, components, prototypepages, and templates are identical for both sites, you can use inheritance to centralize these nodes:
/hst:hst: /hst:configurations: /hst:default: /common: /hst:abstractpage: /hst:catalog: /hst:components: /hst:prototypepages: /hst:templates: /myproject: hst:inheritsfrom: [../common] /hst:pages: /hst:sitemap: /hst:workspace: /hst:channel: /hst:pages: /hst:sitemap: /hst:sitemenus: /hst:containers: /monproject: hst:inheritsfrom: [../common] /hst:pages: /hst:sitemap: /hst:workspace: /hst:channel: /hst:pages: /hst:sitemap: /hst:sitemenus: /hst:container:
Info: The
hst:inheritsfromproperty is multi-valued. You can inherit from multiple configurations by specifying multiple values in the array.
In this setup, shared configuration moves to /common, and project-specific configuration remains under /myproject and /monproject. The hst:inheritsfrom property on each project node defines which configurations to inherit from. If you specify multiple values, inheritance is processed in order from first to last.
Inheritance is coarse-grained: if a child node exists in both the inheriting and inherited configuration, the child in the inheriting configuration takes precedence. For example, given the following structure:
/hst:configurations: jcr:primaryType: hst:configurations /common /hst:pages /aaa /child_of_aaa /bbb /myproject hst:inheritsfrom: [../common] /hst:pages /aaa
/myproject/hst:pagesdoes not hide/common/hst:pages./myproject/hst:pages/aaaoverrides/common/hst:pages/aaa. As a result,/child_of_aaais not inherited.
The effective configuration for /myproject after inheritance resolution:
# with inheritance resolved /myproject: /hst:pages: /aaa /bbb
Default Inheritance
Every configuration implicitly inherits from /hst:default, which has the lowest precedence. Use /hst:default for dependencies outside the current project, such as plugin configurations.
For more details, see default inherited configuration.
Example:
/hst:configurations: /hst:default: /hst:pages: /bbb: /child_of_bbb: /ccc: /child_of_ccc: /common: /hst:pages: /aaa: /child_of_aaa: /bbb: /myproject: hst:inheritsfrom: [../common] /hst:pages: /aaa:
After resolving inheritance, /myproject will have:
# with inheritance resolved /myproject: /hst:pages: /aaa: # from myproject; does not inherit children from common /bbb: # from common; does not inherit children from hst:default /ccc: # from hst:default /child_of_ccc:
Multiple Inheritance
You can inherit from multiple configurations by specifying multiple values in the hst:inheritsfrom property:
/hst:configurations: /common: /common-en: /myproject: hst:inheritsfrom: [../common-en,../common]
The order of values matters. In the example above, /common-en takes precedence over /common.
Info: If a circular reference occurs, inheritance stops at the already inherited configuration node.
Cascading Inheritance
Available in CMS 10.2.0 and later.
Instead of specifying all inherited configurations directly, you can use cascading inheritance. For example:
/hst:configurations: /common: /common-en: hst:inheritsfrom: [../common] /myproject: hst:inheritsfrom: [../common-en]
In this setup, /myproject inherits from /common-en, which itself inherits from /common. This allows you to build layered configuration hierarchies.
Hint: For CMS versions earlier than 10.2.0, use multiple inheritance if you need to inherit from more than one configuration.
Workspace Inheritance
Available in CMS 10.1.0 and later.
By default, hst:workspace nodes are not inherited. Consider the following setup:
/hst:hst: /hst:configurations: /hst:default: /common: /hst:abstractpage: /hst:catalog: /hst:components: /hst:prototypepages: /hst:templates: /corporate: hst:inheritsfrom: [../common] /hst:pages: /hst:sitemap: /hst:workspace: /hst:channel: /hst:pages: /hst:sitemap: /hst:sitemenus: /hst:containers: /subsite: hst:inheritsfrom: [../corporate] /hst:pages: /hst:sitemap: /hst:workspace: /hst:channel: /hst:pages: /hst:sitemap: /hst:sitemenus: /hst:container:
In this example, /subsite inherits pages and sitemap from /corporate and /common. However, /subsite does not inherit the hst:workspace from /corporate unless you explicitly add it to hst:inheritsfrom:
/subsite: hst:inheritsfrom: ['../corporate', '../corporate/hst:workspace'] /hst:pages: /hst:sitemap: /hst:workspace: /hst:pages: /hst:sitemap: /hst:sitemenus: /hst:container:
This configuration ensures that /subsite also inherits the workspace from /corporate. This is useful when subsites need to closely follow the corporate site but override or extend specific pages.
You can also inherit only selected child nodes from a workspace. For example, to inherit all workspace configuration except hst:sitemenus:
/subsite: hst:inheritsfrom: [../corporate, '../corporate/hst:workspace/hst:pages', '../corporate/hst:workspace/hst:sitemap', '../corporate/hst:workspace/hst:container'] /hst:pages: /hst:sitemap: /hst:workspace: /hst:pages: /hst:sitemap: /hst:sitemenus: /hst:container:
You cannot reference nodes below the direct children of hst:workspace in the hst:inheritsfrom property.
Cascading Workspace Inheritance
Explicit workspace inheritance is required. However, with cascading inheritance, if a parent configuration explicitly inherits a workspace, child configurations will also inherit it through the cascade.
Example:
/hst:hst: /hst:configurations: /corporate: /hst:pages: /hst:sitemap: /hst:workspace: /...: /subsite: hst:inheritsfrom: [../corporate, '../corporate/hst:workspace'] /hst:pages: /hst:sitemap: /hst:workspace: /...: /sub-subsite: hst:inheritsfrom: [../subsite] /hst:pages: /hst:sitemap: /hst:workspace: /...:
In this configuration, /sub-subsite inherits from /subsite, and through /subsite, it inherits from both /corporate and /corporate/hst:workspace. /sub-subsite does not inherit from /subsite/hst:workspace unless explicitly configured, but it does inherit from /corporate/hst:workspace via cascading inheritance.