Magnolia 5.7 reached extended end of life on May 31, 2022. Support for this branch is limited, see End-of-life policy. Please note that to cover the extra maintenance effort, this EEoL period is a paid extension in the life of the branch. Customers who opt for the extended maintenance will need a new license key to run future versions of Magnolia 5.7. If you have any questions or to subscribe to the extended maintenance, please get in touch with your local contact at Magnolia.
Inherited components are displayed on child pages automatically. Inheritance saves editors time and effort and it helps display content consistently across the site. For example, use inheritance for promotional content that changes often. When you update the content on the home page it updates everywhere in the page hierarchy.
Inheritance behavior
Inheritance behaves like this by default:
- Editable in parent only: Inherited components can be edited only on the parent page. They don't have toolbars on child pages.
- Order is inherited: Inherited components are displayed in the same order on parent and child pages.
- Inherited first: Inherited components are displayed before non-inherited components in the same area.
Inheritance properties
Configure component inheritance in an area definition. Simple example where all components are inherited:
areas: promos: renderType: freemarker type: list availableComponents: text: id: my-module:components/text inheritance: enabled: true components: all
Node name | Value |
---|---|
areas | |
promos | |
availableComponents | |
text | |
id | my-module:components/text |
inheritance | |
components | all |
enabled | true |
Properties:
| optional, default is
|
| optional, default is Defines which components are inherited to child pages. Valid values:
|
| optional, default is Inherits area properties such as Valid values:
|
nodeComparatorClass | optional, default is Defines the order in which inherited components are displayed on the child page. The default
NodeDepthComparator
follows the order of nodes in the JCR repository. Nodes higher up in the hierarchy are displayed before nodes deeper down. Nodes on the same level are displayed as siblings. This means that inherited components are displayed in the same order on parent and child pages by default. You can implement a custom |
predicateClass | optional, default is In Java, predicate is a functional interface that returns either |
Implementing Filtering
Filtering can be achieved by using the inheritable property. This is a content property set by the component dialog which is then read at render time. In your component dialog add the following field configuration.
- name: inheritable class: info.magnolia.ui.form.field.definition.CheckboxFieldDefinition label: Inherit buttonLabel: Show in subpage defaultValue: false type: Boolean