Containers in dotCMS perform two important functions:
- They allow blocks of code to become re-usable on multiple templates.
- They provide a re-usable formatted display of one or more Content Types, that is usable on on multiple templates.
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.
There are two basic types of containers in dotCMS:
- Zero Content Containers do not have Content Types assigned to them.
- Content Containers allow content creators to add Content of certain Content Types to them.
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.
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: