Applying Templates to Content Containers

Last Updated: 28 Apr 2022

This entire manual refers to a feature that was added in version 5.3.0.0

Once a Content Container Template has been created and its various settings configured, you are then able to apply it to Content Container assets when editing the contents of an asset that supports them, such as a Standard Page.

Content Container Templates are only recommended for Page assets. While you can use Content Container Templates on other asset types you may experience unintended results.

In this example, we will use a Standard Page as the asset type whose Content Container assets we want to apply a template to.

Bookmarks

Selecting a Template

Go to the Edit Contents screen of a Standard Page and click on the Edit Container Properties button of the Content Container you want to apply the template to. This will display the Edit Container Properties box for the chosen Content Container.

Within the properties box, find the Template select field which will list the available templates that can be selected. The list is sorted alphabetically and also includes the Asset ID of each template asset.

Select the template you would like to apply and click on the "Set Properties" button to Commit the screen and save the changes, as shown in the example below.


The Template Selection Field on the Edit Container Properties Box of a Content Container

Note that the Template selection field will only be visible if there are available templates that can be applied on that Content Container.

Editing With a Template

After the screen has reloaded, the Content Container will have the Content Container Template applied including any associated assets that were part of the template asset. The name of the template will also be shown within the header of the Content Container to easily identify which template is currently applied to it.

Below is an example of a Content Container asset that has a template applied. The following code has been added to the Simple Edit Layout used for this template:

%__custom-contents%
%metadata-F_metadata_values%

The template in this example includes a Metadata Schema that displays some configuration options for the template that the editor can configure. The template also still allows the Editor to edit the contents of the Content Container above the metadata fields.


Example of an Edit Contents Screen Which Uses a Content Container Template

The Metadata of a Content Container can also be edited by going directly to the Metadata screen of the Content Container asset in the Admin Mode interface, just like you would normally with Metadata Schemas applied to standard asset types.

Changing Template

Once a template has been applied to a container, it can be swapped for a different template or removed completely in the same way it was applied in the first place. Simply open the Edit Container Properties box again and select a different template or remove it all together by not selecting any template from the list.

You can also apply and change templates from the Details screen of the Content Container asset itself.


Details Screen of a Content Container Asset

Be mindful that when you change a template from one to another and the next template you choose uses a different Metadata Schema, the content within your Metadata on the Content Container will be lost the next time the content is saved.


Previous Chapter