loading table of contents...

Blueprint Developer Manual / Version 2310

Table Of Contents

5.4.10 Dynamic Templating


In order to quickly implement microsites, campaigns, or specialized channels with unique template requirements, templates can be updated without interrupting the service or requiring a redeployment of the application.


Views can be implemented as FreeMarker templates and uploaded to the Content Repository in a container file, preferably a JAR. For details, consult the Section, “Loading Templates from the Content Repository” in Content Application Developer Manual.


In order for the CAE to find the FreeMarker templates, the property delivery.local-resources must be set to "false".

Create the archive containing the templates

A template set archive, preferably a JAR file, can contain FreeMarker templates which must be located under the path: /META-INF/resources/WEB-INF/templates/siteName/packageName/

The easiest way to create the JAR is to create a new Maven module with a POM like this one:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
  <version>--insert version here--</version>
    CAE templates to be uploaded to a CMTemplateSet document in
    /Themes/*my.package*/templates/ with name *my.package*-templates.jar.

    Use the *my.package* as a reference in a Page's
    "viewRepositoryNames" settings (list of strings).


Put your templates below the path src/main/resources/META-INF/resources/WEB-INF/templates/--themeName--/--packageName--/, for example src/main/resources/META-INF/resources/WEB-INF/templates/corporate/com.coremedia.blueprint.common.contentbeans/Page.ftl

Upload the template set

CoreMedia Blueprint provides the content type Template Set (CMTemplateSet) which is used for this purpose. Create a content item of type Template Set in folder /Themes/--themeName--/templates and upload the JAR to its archive property. Its name is significant and is used to reference template sets from channel settings, as explained see below.

description A description of the purpose / contents of the code.
archive blob property that contains the archive (preferably a JAR) that contains the templates.

Table 5.13. Properties of CMTemplateSet

Add the template set to a page

A Page context can be configured to add additional template sets to all pages rendered in its context. The names of additional template sets are configured in a string list setting viewRepositoryNames of a Page. Like all settings, a Page will inherit this list of names form its parent context, if it is not set. See Section 5.4.11, “View Repositories” for more details.



The CAE will resolve view repository names automatically according to the predefined name pattern. For instance, if a Page sets its viewRepositoryNames to the list ["christmas", "campaigns"], each page rendered in this context will use templates implemented in the Template Sets /Themes/christmas/templates/christmas-templates.jar and /Themes/campaigns/templates/campaigns-templates.jar before falling back to the default templates defined for the web application.

Search Results

Table Of Contents

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.