Skip to content
OpenCms documentation
OpenCms documentation

List configuration

OpenCms ships with an integrated list type that supports the collection of list entries via Solr. The list type supports the following features:

  • full text search
  • sorting by title, date or order
  • blacklisting of contents
  • various time range constraints
  • pagination with different page sizes
  • facets for categories
  • facets for folders
  • range facets for time ranges (year and month, as useful for archives)

With the built-in list content type (listconfig) content editors can preconfigure a list that collects one content type or contents of different types in a dynamic list. For example a content editor might display the latest 10 news published within the last month. A formatter displaying a list configuration can read the pre-configured contents and can add further dynamic aspects to the list: interactive searching and sorting as well as faceted filtering and pagination.

The workplace offers a dedicated Lists app for managing of lists.

A content of the integrated list type

To activate the list configuration type for a website, two configuration are needed:

  • configure the list type (listconfig) in your (sub-)sitemap or in one module in your system
  • configure a formatter for type listconfig that allows you to drop the list to your pages.

You can configure the list type to be present globally in your system by configuring in a module, typically the module you provide list formatters with. Or, you can configure it in the sitemap configuration of your site or subsite. Therefor, open the sitemap configuration, e.g., from the sitemap editor by chosing "Advanced -> Sitemap configuration" in the context menu. An example configuration for the list is shown below. Necessary is only to put the "Type name" "listconfig", the other settings are optional.

Configuration of the list content in a module or sitemap configuraiton

Read more about the content type configuration here.

The integrated list is designed to ease list creation. OpenCms 10 introduced the <cms:search> tag and propagated it's use for building lists. Since for most use cases the tag is far too powerful and hence unnecessarily complicated to configure, the integrated list type with all its related features (e.g., a new tag <cms:simplesearch>) is the easy to configure way of building lists that are sufficient for most use cases.

Using the integrated list, all you need to do is writing a formatter for it.

OpenCms does not provide a formatter for the list content type by default. The formatter is very specific for a template, hence there's no point in providing a default one. In essence, you feed the list content into the <cms:simplesearch> tag and then you get the collected contents (and some extra information) as result.

The attribute exposed by <cms:simplesearch> is the same as exposed by <cms:search>. Here, we provide a fully featured demo formatter for dealing with the result.