Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
...
Magnolia provides two mechanisms to reuse a configuration within a YAML-file: !inhert
and !include
. You can use them not only to reuse a definition but also to modify a reused definition.
( Magnolia 5.5.6+)
Use the Magnolia !inherit
directive to inherit a registered definition item in order to create a new definition item, and then modify the new item according to your needs. This directive is very similar to JCR extends. The item you inherit the definition from is referenced by its identifier.
...
Use the Magnolia !include
directive to add a reusable YAML chunk. Include a fragment on a sub-level of your new definition or include a complete definition on top of your new definition. Reference the file you include by its resource path. The path to such a resource has the following pattern: /<module-name>/path/to/the/reusable/chunk.yaml
.
As of Magnolia 5.5.6+ you You can also modify the included part of the definition.
...