Gretyl's Portal

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 edi 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 ID attribute 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.

  • You can add variable elements and map 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. 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 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 ID attribute 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.

    Follow this naming convention your organization name-templates.

  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 ID attribute 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. See XML Comments.

    Figure 4. Topic Template Example.

    The following template includes a table element with labels and guidance text in the draft comment element.

    topic template for change requests
Modify the template content. See Add ID attribute 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 to the map.
  3. Optional: Add any other elements or metadata to the map.
  4. Edit the map template to include desired 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 ID attribute placeholders and Warehouses to a Template.

Add ID attribute placeholders and Warehouses to a Template

Set up content templates to auto-generate new IDs, automatically include author information in the prolog element, and create titles based on the file name.

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. Set the template to generate random, unique IDs for root topic elements or root map elements when a new file is created from the template.
    Remember:

    ID values must start with a letter or number. You cannot just use the [RANDOM] variable for an ID placeholder.

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

    with:

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

    with:

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

    If you have IDs on elements in the body of a topic template, you need to also convert those ID values to use [RANDOM] instead of a specific numeric value. For example:

    • <section id="section-[RANDOM]">
    • <table id="table-[RANDOM]">
  2. Modify the prolog element to populate the author information with the user that creates a new topic or map from the template.
    Replace:
    <author>John Smith &lt;john.smith@acme.com&gt;</author>

    with:

    <author>[CURRENT_USER_FIRSTNAME][CURRENT_USER_LASTNAME]&lt;[CURRENT_USERNAME]&gt;</author>
  3. Optional: Modify the template title element to use the title entered by the user when they create 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 choose to skip 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. Optional: If you want to add reusable content to your template, for example, a copyright topic, make sure that it is located in the main Content folder, and not in the __configuration folder.
  5. 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.

When you create a new map or topic from a template, any reused or shared content is referenced and resolved correctly.

Enable a Template

You enable map and topic templates so they become available in the Create New menu.

  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 source code 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.