Skip to content
OpenCms documentation
OpenCms documentation

Content element configuration

In the page editor, you place content elements of different types. Which are the elements you can place on the page? In which element view do they appear? Can you drop only existing contents, or also new ones? Where are they stored and how do they behave when you copy a whole page? For each type of content element (content type), you can configure it. While in the module configuration, you can choose a kind of default setting, this can be overridden for your sitemap via the sitemap configuration.

We describe the different options available.

Depending on your website or subsite of your website, different content types may be of interest. For example, you may have a subsite for job offers and a special content type for job offers. To allow adding a job offer content only in the subsite, you can configure that such content is only displayed in the add wizard of the page editor when you are in the subsite. Moreover, if you use two different templates in parallel, you can configure the relevant content types for each site separately.

Besides the visibility of content types, it may also be of interest where you store content, e.g., if you want a list of all job offers you can choose to only collect offers from a special folder.

Additionally, you can select element views in which a content type should be displayed. Thus you can control which users can add, edit or move elements of which content type and which elements should be edited in which view.

A correct content element configuration in your module lets you expose content types exactly as you want. A suitable configuration of content types for a sitemap eases editing content because you can restrict the available types to the really relevant ones and, if still too confusing, group them in multiple views.

The content element configuration is also possible in sitemap master configurations. It's typically the best place for them if you predefine one configuration for your template. In the sitemap configuration you just link to the relevant master configuration.

In module and sitemap (master) configurations, you can configure ADE related options for each content type. The following screenshot shows the configuration options for one type.

Configuration options for one content type as shown in the form-based editor (module configuration)

Select the resource type you want to configure.

You can restrict the usage of contents of the type. There are manifold options, written very verbose and self-explaining. So check them in your installation.

Choose in which folder the content should be stored. In the module configuration you can only choose the name of the folder where the content is stored in.

In the sitemap configuration you have more options:

  • an absolute path
  • just a folder name or
  • the option "With page".

If you choose the folder name, the content will be placed in a subfolder of .content/  with the given name. If, in a sitemap configuration, you choose "Local contents", the sitemap's local .content/ folder will be used, otherwise a .content/ folder of an above sitemap. By default, the subfolder named {resource type name}/ .

If you use the option "With page", the content is stored in the .elements/ subfolder of the folder the edited page is in.

The name pattern to be used if new content of the specified resource type is added to a page. A typical pattern has the format {prefix}_%(number).xml. Be sure to use the %(number) macro to guarantee distinct names for all contents in a folder. The default name pattern is {resource type name}_%(number).xml.

In the "Add wizard", the content types are listed in a specific order. Via the "Display order", you can influence the order in which the types are listed. The higher the display order, the further down the type is listed.

For sitemap configurations, the order in which the types are listed determines the order they are displayed. The types configured for the sitemap are also always shown before the ones only configured in modules.

The add wizard of the sitemap editor has a tab "Detail pages" where you can add detail pages for content types. If you check "Disable detail pages", a page for the content type will not appear.

Resource types can be grouped in element views. Elements of a type can only be added, edited or removed from a page if the specific view is chosen. Otherwise, for all elements of the type, neither edit points are shown, nor are the types visible in the add wizard. Element views can be used to separate tasks or to control access to content types. Read more about them here. By default, the "Default" element view is chosen.

Link to a message bundle that holds the localizations for that type (e.g., title and description of the type in the "Add wizard") and must be treated as workplace bundle.

Note that bundles with name {module name}.messages are automatically workplace bundles and you do not need to add an extra bundle here if you use them.

If checked, (edit points on the) elements of the content type are not only shown in the specified element view, but also in the default view.

Configure the default "Copy this element" value for elements of that type. I.e., specify if they are copied or reused when a container page (template) is copied. Default is copy.

When you remove an element of the type from the page - and it is it's last occurrence on a page - you might want to delete or keep it. Here you specify what should happen in this scenario. The options are:

  • Keep: The element is not deleted.
  • Ask user (default: Keep): A dialog is shown to the user, where he can choose if the element should be deleted. Keep is preselected.
  • Ask user (default: Delete): A dialog is shown to the user, where he can choose if the element should be deleted. Delete is preselected.
  • Delete: The element is deleted.

In a sitemap (master) configuration, in addition to the configuration of single resource types, some settings that influence the configuration of all resource types are available.

Select a master configuration to use as default. You can still override parts of it. Read more about the master configuration here.

Disables all resource types configured via module configurations or parent sitemaps or linked master configurations. In consequence, only resource types explicitly configured in the sitemap will be available.

If checked, a local .content/ folder is created and, whenever as "Folder" in a resource type configuration only a name is chosen, the resources will be stored locally in a subfolder of the .content/ folder. If the option is not checked, the .content/ folder of a parent sitemap or the site will be used.

If you link to content that is stored locally in the sitemap and your sitemap has a detail page for content of that type configured, then this detail page will be preferred over a detail page that might be configured for the calling (sub-)site, i.e., the (sub-)site where the link to the content is placed. If the option is not checked, the detail page from the "calling (sub)site" will be preferred.

The feature only works for content that is stored locally in a folder under the (sub-)sitemaps main folder.

If enabled, contents from other (sub)sitemap will not be displayed on detail pages of this (sub)sitemap.

Sub-sitemaps are by default not visible in the site selector, but you can force a sub-sitemap to be added to the selection if you check this option.

Each content element configuration allows to add a display order for the content element. If this sort option is checked, that order is used for sorting the content elements. Otherwise, the order they are listed in the configuration is used, but this can cause problems when stacking master configurations, since the types from the "nearest" configuration are always on top in this case.

By default, OpenCms shows elements that can't be added to a container page grayed out. Via this option you can alternatively hide content elements that can't be added.