Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
This page explains how you can reuse JCR based configuration of Magnolia definition items with the
The JCR extends mechanism is based on JCR nodes and properties. JCR configuration data can be extended on any node level, and thus on any level of configuration. JCR extends allow to extend sub items of a JCR-defined item definition.
You can extend a JCR configuration by defining an
extends property and setting its value to the source configuration you want it to inherit. The target configuration inherits everything from the source and adds its own exceptions. This can save time and effort as you only need to define exceptions explicitly. Use
override to exclude sub-nodes of the extended node.
The mechanism is only available in the
In the example below, the
sportstation site definition extends the
The definition inherits all configuration from the
default configuration and adds its own domains, internationalization and URI-to-repository mappings. The
extends property can point to the source configuration with an absolute or relative path. The nodes
You can use Magnolia's extends mechanism to minimize configuration. For example, if you have a number of components that include an image, you can configure a generic image tab and use it by extension in all relevant dialogs.
This example configuration shows the use of a generic
imageTab in a
Path to the configuration that is extended.
You can configure one template in full and create as many extensions with slight differences as you like. The mechanism is used to minimize configuration. Only changes, exceptions and additions are configured in the extended configuration. All other configurations are taken from the original configuration.
extends property has two possible values:
</path to extended template>: Used to reference the template that is extended.
override: Used to override a portion or part of the configuration that is extended.
In the example below
page-template-1. The extended template uses the full configuration of the template it extends except the configurations in the extended template.