Containers - Documentation topics on: code block,code re-use,container properties,containers,footers,headers,max contents,menu bar,navigation bar,zero content,.


Containers in dotCMS perform two important functions:

  1. They allow blocks of code to become re-usable on multiple templates.
  2. They provide a re-usable formatted display of one or more Content Types, that is usable on on multiple templates.

Page Components Diagram

Properly created containers control how the fields from the content will display on a page, so content publishers don't have to worry about coding or CSS styling of the content. Content Publishers simply contribute content by filling out each field available on the content type, and as the content is saved it displays on the page with the appropriate styling for that content type.

Containers can be used on one or many dotCMS templates.

Container Types

There are two basic types of containers in dotCMS:

Zero Content Containers (Headers, Footers, Side Navigation, etc.)

Zero Content Containers do not have Content Types assigned to them. The Max Contents property of the Container must be set to 0, and content contributors will not be able to add Content to them.

They act like server-side include files and can be used to place reusable HTML elements, Javascript and Velocity code across templates and pages. This type of container is useful for highly re-used elements such as global headers and footers, main menu bars and navigation, and other code blocks used site-wide (which do not need to change on different pages).

Zero Content Container Properties

Content Containers

Content Containers allow content creators to add Content to them. Content Container properties define all of the following:

  • Which Content-Types can be contributed to the container (one or many)
  • How fields on the content should be formatted
  • How many pieces of content can be contributed to the container on a single page
  • Whether the content can edited through the “inline editing mode”
  • Which users have permission to contribute content to the container

If the Max. Contents property is set to any number higher than zero, then the following container properties can be set on a Content Container:

Content Container Properties