Add Variable Data and Warehouses to a Template

Modify the template ID, author information in the prolog element, and the template title.

Open a map template or topic template in the Source Editor. See Edit the Topic XML Code or Edit the Map XML Code.
Configure variable data
  1. Set the template to generate random IDs for root topic elements or root map elements.
    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. For any paths to maps or topics that are not templates, for example, a warehouse map or a copyrights topic, change the relative path in the href to an absolute path to its location in the database.
    1. In the content library, click on the map or topic in question to open the Resource Details Drawer.
    2. In the Overview section, click on the API Info to expand it.
    3. Copy the entire URI.
      API info section
    4. Go back to the map or topic you're updating.
    5. Switch to the Source Editor.
    6. Replace the relative path in the href attribute with the URI that you copied.

      This is an example of a relative path to a warehouse map:

      <mapref format="ditamap" href="../../../global_shared/documents/global_shared.ditamap" processing-role="resource-only"/>

      This is an example of the same mapref, but we've replaced the relative path with the database URI:

      <mapref format="ditamap" href="/db/organizations/myorg/repositories/master/global_shared/documents/global_shared.ditamap" processing-role="resource-only"/>
      Tip: The process is the same for topics. Do this only for topics that are reused or shared, for example, copyrights or legal notices.
    7. Save the changes.

      When you create a new map or topic from a template, any reused or shared content will resolve no matter where in the repository you create the new map or topic.