The purpose of a Content Template is to render a Content Type as a full independent webpage.
There can be several different Content Templates for a single component that can be used in different rendering situations.
The default template for content is used when a template is not explicitly defined in the URL.
For pages, the default template is equivalent to the page selected by the content author when editing.
For other content, a default template can be assigned. This is done by selecting the "Can be used as default" option in the Studio. In the case of two content templates being applicable to the same content type, the one with higher priority is used.
Assigning a Content Template for rendering is demonstrated in the following example:
http://www.digitall.com/jahia/cms/render/defaut/en/sites/Digitall/home/newsList/news1.detail.html
Note that the content news1
will be rendered using its detail
Content Template. For this example, we assumed that this Content Template exists for Content of type news
.
Under the (second) template tab, right click the Base template and select "New Content Template".
On top of the base template fields, the window provides different options:
A Main Resource Display is an object within a Template that informs on which view is used to render a piece of Content. It should only be used in Content Templates.
The edit window provides a field for selecting which views are used to display the main resource. When none are selected, the default view is used.
Below is an example of a completed Content Template for a piece of Content of type Event
. Note the main resource displays being used and the views that were selected for each of them.