Inheritance group (deprecated)
Inheritance groups are elements that group contents. In contrast to reuse model groups and element groups, the elements can change from page to page. We explain how to use inheritance groups.
Description
An inheritance group is similar to an element group by means that they allow you to drop a set of content elements into your page as a single object. But element groups don't allow you to change the set of elements only for a specific subset of pages. When you make a change to an element group, this change is visible across all pages using that element group. This is the problem that inheritance groups are meant to solve.
When changing an inheritance group on a page, the content of the same group will only be changed on the page and any pages which are descendants of the page's parent folder. In other words, changes will be "inherited" by the group in child pages, but nowhere else. For example, you may want to define an inheritance group for the right column of your template, define some common content which you want to be visible everywhere on your site, and then add more specific contents for each subsite.
Basic definitions
We will call a container page a.html
a descendant page of another container page b.html
if the parent folder of a.html
is a direct or indirect subfolder of the parent folder of b.html
. Conversely, we call b.html
an ancestor page of a.html
. When editing a container page, we call the parent folder of that page the current folder. This is important because inheritance group data is attached to folders, not to individual container pages. So container pages in the same folder can't have different content for the same inheritance group.
Creating new inheritance groups
You can create a new inheritance group in the page editor by opening the Add wizard and dragging an "Inheritance group" from the "Types" tab onto your page. As with other resources, the inheritance group will only be created in the VFS once you edit it.
Changing inheritance groups
To edit an Inheritance group, first you need to open a container page that contains the inheritance group. Hover over the Edit point of the inheritance group and click the edit symbol
. Now the Inheritance group editor will pop up where various actions can be performed.
Adding content elements
Removing content elements
Clicking on the remove symbol in the inheritance group editor will perform one of two actions, depending on where the content element was added to the Inheritance group:
- If the content element was added to the inheritance group of the currently edited page or a page in the current folder, the element will just be removed from the inheritance group, and will not appear in the inheritance group on any descendant pages.
- If the content element was added to the inheritance group in an ancestor folder, the element will be hidden, and will also be hidden in the inheritance group on descendant pages. The difference to normal deletion is that a hidden element can be set to "visible" again in a descendant page and is still present on anchestor pages.
Inheritance status
Showing previously hidden elements
The inheritance group editor's "Show removed"/"Hide removed" button will toggle the display of elements which have been hidden from the inheritance group in an ancestor folder in the inheritance group editor. To show a hidden element in the current page, first click on the "Show removed" button that displays the hidden elements. They are displayed with diagonal stripes on top to distinguish them from the other elements. Now hover the Edit point of the element you want to show and click the "Add content" button from the appearing menu.
Breaking up the group
When using the "Break up" button, the inheritance group will be replaced by its current, individual content elements in the container page, just as with element groups.
Editing element settings
Just like with other container page elements, the element settings of inheritance group elements can be edited. But note that element settings can only be changed for an element if that element was added to the Inheritance group in the current folder. If the element was added to the inheritance group in a different folder, the option for editing element settings will not appear.
Internals
There are two resource types used for the implementation of inheritance groups: inheritance_group
and inheritance_config
. inheritance_group
is the type of the contents that are actually inserted into the container page when creating new inheritance groups or dragging existing inheritance groups into a page. They only contain the internal id of the inheritance group they represent.
The resources of type inheritance_config
contain the actual contents of the inheritance groups. The inheritance group changes for a folder will be stored in a file (of type inheritance_config
) named .inherited
which is contained in the same folder. Since only one file per folder is used, data for multiple Inheritance groups will be stored in the same file. The content of this config file should not be edited manually.