OpenCms Documentation

Content element configuration

 Show GitHub edit links  Hide GitHub edit links
In OpenCms since: 8.0 Valid for OpenCms: 11.0.0

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.

What is the content element configuration for?

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.

Content element configuration

In module and sitemap configurations, you can configure ADE related options for each content type. Figure [content_element_configuration] shows the configuration options for one type.

Fig. [content_type_configuration]: Configuration options for one content type as shown in the form-based editor (module configuration)
Content type configuration options
Type name

Select the resource type you want to configure.

Disabled

You can restrict the usage of contents of the type. These are the options for "Disabled":

  • False: Everything is enabled, i.e., adding new and existing content of that type to a page is possible.
  • Creation disabled: The type is shown in the "Add wizard" of the page editor, but only existing contents can be dropped to the page. No new contents can be created in the page editor.
  • Adding disabled: The type does not appear add all in the "Add wizard" of the page editor. Hence, contents of that type can't be dropped to the page. But already existing contents can be edited. If, for example, a content is placed on a model page and copied with each new page, editors can change this content.
  • True: The type does not appear in the "Add wizard" of the page editor. Everything is disabled. Even contents of that type already on the page cannot be edited.
Folder/Name

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.

Name pattern

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.

Display order (module configuration)

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.

Detail pages disabled

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.

Element view

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.

Localization (module configuration)

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.
Show in default view

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.

Copy in templates

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.

Delete mode

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.

Special settings for the sitemap

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

Sitemap-specific resource type configuration options
Master configuration

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

Disable all

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

Local content elements

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.

Prefer local detail pages

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.

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.