Add ID attribute placeholders and Warehouses to a Template

Set up 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.
Configure ID attribute author information placeholders.
  1. Set the template to generate random IDs for root topic elements or root map elements when a new file is created from the template.
    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>
Add warehouses or other reusable content.
  1. Optional: If you want to add reusable content to your template, for example a warehouse map or a copyright topic, make sure that this reusable file resides in the main content folder, and not in the __configuration folder.
  2. Save the template file.
    When you create a new map or topic from a template, any reused or shared content will be referenced and resolved correctly.