Under maintenance

Heretto Help

Show Page Sections

Content Templates

Content templates are predefined templates for creating content. They are useful for document types that are often used. They ensure that your content is consistent and make the authoring process faster. Any user with the privileges to create new files in Heretto CCMS can create and edit templates for topics and maps.

When a template is created and enabled, it can be used from the Create New drop-down menu by any user with the privileges to create new files in the CCMS.

Tip:

If all your policy documents follow a similar format, it may be a good idea to create a template that contains the basic elements and structure used in that document type.

Note:

If you use id attribute placeholders in the templates, you are expected to see an XML validation warning red warning triangle with an exclamation mark next to the template in the Content Library. Ignore the warning. For more information, see Add Placeholders and Warehouses to a Template.

Guidelines

Keep these guidelines in mind when creating templates:

  • You can restrict access to template configuration files to prevent unwanted changes to the templates by using permissions.

  • You can add variable elements and metadata to a template.

  • You can provide internal guidance on how to use a template by including draft comment elements or XML comments in the template. Text in draft comment elements is not included in outputs. For information on using XML comments, see XML Comments.

  • You can include any allowed elements or content in a template.

Examples

Figure 1. Change Request Topic Template
topic template for change requests
Figure 2. Briefing Note Topic Template
topic template for briefing notes
Figure 3. Policy Map Template
map template for policy guides

Templates or specializations?

Templates are based on standard DITA map and topic elements and can be created by anyone. Specializations are extensions of the standard DITA content types and elements. If you are interested in using specializations, contact your Customer Success Manager.

Note:

If you use id attribute placeholders in the templates, you are expected to see an XML validation warning red warning triangle with an exclamation mark next to the template in the Content Library. Ignore the warning. For more information, see Add Placeholders and Warehouses to a Template.

Configure a Template Process

Implementing templates in Heretto CCMS requires initial configuration.
  1. In the __configuration folder in the Content Library, go to the templates folder.
    Note:

    If you don't see a __configuration folder in your Content Library, contact your Customer Success Manager.

  2. Create a new folder to keep your templates separate from the default templates.
    Tip:

    We recommend this naming convention your organization name-templates for the folder name.

  3. In the new folder, create a folder for each template.
  4. Create template resources:
  5. Modify topics and maps so they can be templates. See Add Placeholders and Warehouses to a Template.
  6. Make the template available in the Create New menu. See Enable a Template.

Create a Topic Template

Create a topic template with the desired structure and content.

  1. In the Content Library, in the __configuration folder:
    1. Click Create New and select a topic type that you want to use as a template.
      If you create a template for reference material such as a data sheet, select Reference.
    2. If needed, enter a title and modify the file name.
      Note:

      The valid characters for file and folder names are:

      • lowercase letters (a-z)

      • uppercase letters (A-Z)

      • numbers (0-9)

      • underscore (_), hyphen (-), and period (.)

      This applies to creating files and folders and renaming files and folders.

    3. Click Create & Edit.
  2. Edit the topic template to include desired elements, text, or guidance.
    Note:

    You can provide internal guidance on how to use a template by including draft comment elements or XML comments in the template. Text in draft comment elements is not included in outputs. For information on using XML comments, see XML Comments.

    Figure 4. Topic Template Example.

    This example template includes a table element with labels and guidance text in the draft comment element.

    topic template for change requests
Update the topic to have the template format. See Add Placeholders and Warehouses to a Template.

Create a Map Template

Create a map template with the desired topics, elements, and content.

  1. In the Content Library, in the __configuration folder:
    1. Click Create New and select a map type that you want to use as a template.
    2. Enter a title and modify the file name if needed.
      Note:

      The valid characters for file and folder names are:

      • lowercase letters (a-z)

      • uppercase letters (A-Z)

      • numbers (0-9)

      • underscore (_), hyphen (-), and period (.)

      This applies to creating files and folders and renaming files and folders.

    3. Click Create & Edit.
  2. Add topics that you want to include in the map.
    • For topics that already exist in the Content Library, for example, a copyright notice, use the Open Library option to drag those topics into your map template.

    • For topics that should be unique within each map, create topic templates in the same location as the map, and add the topics to the map. Be sure to follow the topic template guidelines in Create a Topic Template.

  3. Optional: Add any other elements or metadata to the map.
  4. Edit the map template to include any needed usage guidance.
    Note:

    You can provide internal guidance in maps by using XML comments. We recommend using tooltip XML comments. See XML Comments.

Update the map to have the template format. See Add Placeholders and Warehouses to a Template.

Add Placeholders and Warehouses to a Template

Set up content templates to auto-generate new IDs, automatically include author information in the prolog element, create titles based on the file name, reuse content, and more. For a complete list of placeholder options with examples, see Content Templates Placeholder Options Reference.

Open a map template or topic template in the Source Editor. See Edit the Topic XML Code or Edit the Map XML Code. Templates are located in the __configuration folder.
  1. Modify the template id attribute to generate random IDs for root topic elements or root map elements when a new file is created from the template.

    You can use one of three placeholders to automatically generate an ID when you create a new topic or map. The [RANDOM] placeholder generates up to 10,000 different 4-digit ID numbers. Use it to generate element IDs. The [RANDOM_UUID] placeholder generates unique values in this format, 12345678-1234-5678-123456. Use it to generate map and topic IDs. The [FILE_UUID] placeholder inserts the resource UUID as the id attribute value. Use it to generate map and topic IDs that match the file UUID.

    Important:

    Map ID values must start with a letter. Topic ID values must start with a letter or number. Otherwise, validation errors in files created from templates will occur.

    For topics, replace:
    <topic id="topic-3460">

    with:

    <topic id="topic-[RANDOM_UUID]">

    or

    <topic id="topic-[FILE_UUID]">
    For maps, replace:
    <map id="ditamap-3981">

    with:

    <map id="ditamap-[RANDOM_UUID]">

    or

    <map id="ditamap-[FILE_UUID]">
    Important:

    If you have IDs on elements in the body of a topic template, you need to also convert those ID values to use a placeholder instead of a specific numeric value. For element IDs, we recommend using [RANDOM]. Element ID values can contain placeholders with and without prefixes. For example:

    • Element ID placeholder with a section- prefix: <section id="section-[RANDOM]">

    • Element ID placeholder without a prefix: <table id="[RANDOM]">

  2. Optional: Modify the template id attribute to use the title entered by the user as the topic ID.

    This setting retains underscores and hyphens from the title text text you type in the Create new window and replaces any spaces with underscores (_).

    Replace:

    <topic id="topic-3460">
    

    with:

    <topic id="[REQUESTED_FILE_NAME_ESCAPED_WITHOUT_EXTENSION]">
    
  3. Optional: Modify the template title element to use the title entered by the user when creating a new topic or a map from the template.
    Tip:

    Skip this step if you want to use a consistent map or topic title, such as Policy & Procedures. If you complete this step, users will be prompted to enter a unique file name, but will not be able to change the title of the document from the Create new window.

    Replace:
    <title>Policy &amp; Procedures</title>

    with:

    <title>[REQUESTED_FILE_NAME_WITHOUT_EXTENSION]</title>
  4. Modify the author element to use the details of the user who creates a topic or map from the template.
    Replace:
    <prolog>
    	<author>John Smith <john.smith@acme.com></author>
    </prolog>

    with:

    <prolog>
    	<author>[CURRENT_USER_FIRSTNAME] [CURRENT_USER_LASTNAME] &lt;[CURRENT_USERNAME]&gt;</author>
    </prolog>
  5. Optional: If you want to add current time to the file in a specific format, add the critdates element to prolog under the author element.

    You can configure your preferred date and time format and include a time zone. For more information, see Content Templates Placeholder Options Reference.

    <prolog>
    	<author>(...)</author>
    	<critdates>
    		<created date="[CURRENT_DATETIME_FORMATTED_BY_yyyy/MM/dd]">
    	</critdates>
    </prolog>
  6. Optional: If you want to add a date picker to the Create new window where users can set a past, present, or future date upon file creation, add the critdates element to prolog under the author element.

    You can configure your preferred date format. For more information, see Content Templates Placeholder Options Reference.

    <prolog>
    	<author>(...)</author>
    	<critdates>
    		<created date="[DATE_FORMATTED_BY_yyyy/MM/dd]"/>
    	</critdates>
    </prolog>
  7. Optional: If you want to add reusable content to your template, for example, a copyright topic, make sure it is located in the main Content folder, and not in the __configuration folder.

    You reuse content in a template just like you would in a regular map or topic.

  8. If you want to create new, unique topics at the same time as you create a new map, create the topic templates in the same templates folder as the map in the __configuration folder.

    Be sure to add the topic content templates to the map and and configure the ID value placeholder in each topic.

    Note:

    For topic templates that will be created as new topics when you create a new map, you do not need to create a corresponding XML file to enable those topics. See Enable a Template for more information.

  9. Save the template file.
    Note:

    When you click Save, an invalid XML notification appears due to the [RANDOM] value in the id attribute. This is expected. Save the file anyway. Ignore the validation warning red warning triangle with an exclamation mark that appears in the Content Library for the same reason.

Enable the new templates so that they are available in the Create New drop-down menu.

Enable a Template

You enable map and topic templates to make them available in the Create New drop-down menu. Complete this procedure only for templates you want available in the menu. If you are creating a map template with new topics, complete this procedure only for the map - unless you want the topics available in the menu too.
  1. In the __configuration folder in the Content Library, navigate to templates/topics/topic.
  2. Right-click topic.xml and select Download > File.

    If you are enabling a map, from the templates/maps/map folder, download map.xml.

  3. Open the downloaded topic.xml file in a text editor like Notepad++.
    The topic.xml file looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <template>
    	<label>Custom Topic Template</label>
    	<instance source="custom_topic_template.dita"/>
    </template>
  4. In the <label> element, type the template name you want listed in the Create New menu.

    Replace:

    <label>Custom Topic Template</label>

    with:

    <label>Briefing Note</label>
  5. In the instance element, change the source attribute value to the file name of the topic or map you want to enable as a template.

    Replace:

    <instance source="custom_topic_template.dita"/>

    with:

    <instance source="briefing_note_template.dita">
  6. Save the topic.xml file with a file name that matches the template file name.
    Save the file as briefing_note_template.xml
  7. Upload the file to the __configuration folder, in the same location in the __configuration folder as the template that you are enabling.
  8. Refresh your browser.
  9. Open the Create New menu to confirm that the new template is listed.
  10. Recommended: Create new topics or maps to ensure that you have configured the templates properly.

Disable a Template

If you no longer need a template or you don't want a template to be available in the Create New drop-down menu, you can disable it by commenting out the <label> and <instance> elements in the .xml file relevant to that template.

  1. In the Content Library, go to the __configuration folder and find the .xml file associated with the template you want to disable.
  2. Right-click the .xml file and select Edit Source.
  3. Place your cursor in the <label> element, right-click and select Command Palette. Type comment and select Add Line Comment.
    Figure 5. Adding a Line Comment
    L uoayer 1

    You commented out the <label> element.

    Figure 6. A commented out <label> element
    A commented out <label> element
  4. Repeat 3 to comment out the <instance> element.

You have disabled the selected content template. As a result, this template is no longer visible in the Create New drop-down menu.

Content Templates Placeholder Options Reference

Several placeholders are available for use in content templates. When you use these placeholders, the CCMS populates the actual content when you create new content topics or maps.

[RANDOM]

Generates up to 10,000 different 4-digit ID numbers in an id attribute value. Use it to generate element IDs. Element ID values can contain placeholders with and without prefixes, however, using a letter or word as a prefix is best practice, especially for HTML4 output. For more information, see w3.org.

Element ID placeholder with a section- prefix:

<section id="section-[RANDOM]">
[RANDOM_UUID]

Generates a random a random 128-bit hexadecimal identifier (0-9, A-F) in this format, 1411fz2f-efdd-4892-83a0-53adf1148c83, in an id attribute value. Preferred over [RANDOM] to generate map and topic IDs.

<map id="map-[RANDOM_UUID]">
Important:

Map ID values must start with a letter. Topic ID values must start with a letter or number. Otherwise, validation errors in files created from templates will occur.

[FILE_UUID]

Inserts the resource UUID in an id attribute value. Preferred over [RANDOM] to generate map and topic IDs. Generates IDs that match the file UUID. For details about resource UUID, see Get a Resource UUID.

<map id="map-[FILE_UUID]">
Important:

Map ID values must start with a letter. Topic ID values must start with a letter or number. Otherwise, validation errors in files created from templates will occur.

[REQUESTED_FILE_NAME_ESCAPED_WITHOUT_EXTENSION]

Inserts the file name in the map or topic ID value. Underscores and hyphens are retained, and spaces are replaced with underscores (_). Use instead of the [RANDOM], [RANDOM_UUID], or [FILE_UUID] placeholders.

<topic id="[REQUESTED_FILE_NAME_ESCAPED_WITHOUT_EXTENSION]">
[REQUESTED_FILE_NAME_WITHOUT_EXTENSION]

Generates the topic title based on what you type for the file name.

<title>[REQUESTED_FILE_NAME_WITHOUT_EXTENSION]</title>
Note:

If you use this placeholder, users will be prompted to enter a unique file name, but will not be able to change the title of the document from the Create new window. If you want to use a consistent map or topic title, such as Policy & Procedures, add Policy &amp; Procedures the title to the template.

[CURRENT_USER_FIRSTNAME], [CURRENT_USER_LASTNAME], [CURRENT_USERNAME]

Inserts the file creator's first name, last name, and CCMS user name (e-mail address) respectively as specified in their user configuration.

<prolog>
        <author type="creator">[CURRENT_USER_FIRSTNAME] [CURRENT_USER_LASTNAME] &lt;[CURRENT_USERNAME]&gt;</author>
</prolog>
[CURRENT_DATETIME_FORMATTED_BY_yyyy/MM/dd]

Inserts a snapshot of the current time upon file creation. The value is provided in the format of Year/Month/Day and can't be modified by users upon file creation. The snapshot created by this placeholder is visible only in the XML. The date visible in the Created field of the Overview tab is a CCMS metadata saved independently.

<prolog>
	<author>(...)</author>
	<critdates>
		<created date="[CURRENT_DATETIME_FORMATTED_BY_yyyy/MM/dd]">
	</critdates>
</prolog>

If you want dates to be in the format of Day/Month/Year, replace yyyy/MM/dd with dd/MM/yyyy.

Note:

You can configure your preferred date and time format and include a time zone according to these internationalization conventions. Use an underscore (_) as a separator, for example, to separate date and time: yyyy/MM/dd_H/m.

  • y - year (yyyy = 2025, yy = 25)
  • M - month (MMMM = October, MMM = Oct, MM = 10, M = 9)
  • d - day of month
  • E - day of week (EEEE = Wednesday, EEE = Wed)
  • h/H - hour (12/24-hour)
  • m - minutes
  • s - seconds
  • a - AM/PM
  • z - time zone
[DATE_FORMATTED_BY_yyyy/MM/dd]

Adds a date picker to the Create new window where users can set a past, present, or future date upon file creation. The snapshot created by this placeholder is visible only in the XML. The date visible in the Created field of the Overview tab is a CCMS metadata saved independently.

<prolog>
	<author>(...)</author>
	<critdates>
		<created date="[DATE_FORMATTED_BY_yyyy/MM/dd]"/>
	</critdates>
</prolog>

If you want dates to be in the format of Day/Month/Year, replace yyyy/MM/dd with dd/MM/yyyy. With this placeholder, you can only configure the year, month, and day.

Figure 7. A date picker in the Create new window
Layer 1
Note:

You can configure your preferred date and time format according to these internationalization conventions.

  • y - year (yyyy = 2025, yy = 25)
  • M - month (MMMM = October, MMM = Oct, MM = 10, M = 9)
  • d - day of month