Groups of content
OpenCms 10+ provides new ways to group content: model groups. These can, in contrast to element groups, deal with nested containers. Basically, model groups are just container pages with an element marked as root of the group. This element, and all elements nested in it, can be placed on any container page as a whole.
There are two kinds of model groups: reuse and copy groups. Reuse groups are only editable directly via a special view in the sitemap editor. They are a good solution for headers and footers, i.e., content that is the same everywhere and editable in a central place. Copy groups are an experimental feature at the moment. They allow to drag a group of elements to a page in one step. Contrary to reuse groups, the group itself disappears when dragged to a page.
Why grouping content?
Grouping content has two purposes
- Reuse the same group of content in different places and be able to edit it in just one place
- Drag a whole set of contents to a page at a time, e.g., a pre-filled row in bootstrap template or a the collection of container page elements that format different parts of the same content or several different contents.
The first use case was possible in OpenCms before version 10 by using element groups. But these do not support nested containers and hence are not suitable anymore. Since OpenCms 10.5 elements groups are even not fully configured by default. They are considered deprecated. The adequat replacement for them are reuse groups, described here.
The second use case is completely new and implemented by copy groups. These are just experimental at the moment and for the use case of placing various containerpage elements on a container page at the same time. A similar feature (but for adding the same content with a formatter combined of various "micro formatters") that can be used alternatively for some scenarios are macro formatters.
Using model groups
Once a model group is created, it can be added to any page via the page editors "Add wizard". Choose the element view "System elements" and click on "Model group" to see the available groups (see Fig. [system_elements]).Of course, you can configure model groups to appear in another element view in your sitemap configuration. Reuse groups have a blue icon, copy groups a red one (see Fig. [add_existing_model_group]).
Creating and editing model groups
Model groups can be viewed as part of the template. They are managed via the "Templates" view of the Sitemap editor (see Fig. [sitemap_editor_template_view]). Each model group is a complete container page with one element marked as root element of the group. I.e., it consists of the group content itself and the surrounding structure. That means, creating a model group is creating a container page and marking what element is the root of the group. When the group is used, only the marked element (and all elements nested in it) are used.
The model groups should use your template and you build up (part of) the site structure exactly as for your normal container pages. The special features are: An element can be marked as a reuse or copy group. Furthermore, for copy groups the copy behavior of each element in the group (except the root element that is always reused) can be adjusted as well - similar to the "Copy this element" setting in template models. For elements in copy groups the "Copy this element" setting is available as well, but has no influence, since everything is reused..
You mark an element as copy or reuse group via a specific element setting, shown in Fig. [settings_at_model_group_pages].