Search the documentation
 Show GitHub edit links  Hide GitHub edit links
In OpenCms since: 10.0 Documented since: 10.0 Latest revision for: 10.5 Valid for OpenCms: 10.5.2

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 not even activated 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]). Reuse groups have a blue icon, copy groups a red one (see Fig. [add_existing_model_group]).

Fig. [system_elements]: The "System elements" element view in the add wizard
Fig. [add_existing_model_group]: Add an existing model group in the "Add wizard". Reuse groups are blue, copy groups red.
Model groups behave exactly like their root element when they are added, i.e., they fit only into containers where the root element fits in.

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.

In OpenCms 10.0 you created and edited multiple model groups on one page. This is not possible anymore. Model groups created with version 10.0 can still be used, but not edited anymore.
Fig. [sitemap_editor_template_view]: Model group pages in the sitemap editors template view

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..

If you mark an element as copy or reuse group, it gets a name and a description, used to identify it in the "Add wizard". Fig. [settings_at_model_group_pages] shows the special element settings for creating a model group. Fig. [model_group_example] shows how groups are highlighted in the model group page.

You can copy a template to create a model group by using it's context menu option "Copy for model group".
Fig. [settings_at_model_group_pages]: The special element settings available when editing model groups
Fig. [model_group_example]: Example model group as shown when edited (special Apollo Template style)

You can improve this page

Please contribute your suggestions or comments regarding this topic on our wiki. For support questions, please use the OpenCms mailing list or go for professional support.