Adding variables to a map template

You can add variables or parameters to the map template to provide fields to users so they can enter variable values at map creation.

To create a variable field, type {{value}} inside an element and replace value by a name which represents the kind of information you want the user to provide.

For example, if you include the author element in your bookmeta element in your bookmap template, you can create a variable for the content that you want a user to provide during map creation, as follows:

<bookmeta>
	<author>{{AuthorName}}</author>
</bookmeta>

When a user clicks IXIASOFT CCMS > Create Map, the names of the variables contained in the template are made available in the Create Map dialog box. In this example, a user sees AuthorName in the Template Variables table, and can enter any string of characters as a value.

Figure: Example of the variables in the Create Map dialog box.
Screenshot of the template variables section of the Create Map dialog box
Important:
If you are adding variables to an existing map template, verify that the following items in the map template have also been replaced by map variables:
  • Replace the existing map ID attribute value with {{ixia.id}}.
  • Replace the existing xml:lang attribute value with {{ixia.xml:lang}}.
  • Replace the existing title with {{ixia.title}}.
For example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//IXIA//DTD IXIA DITA Map//EN" "../../system/dtd/ixia/IxiaMap.dtd">
<map id="{{ixia.id}}" xml:lang="{{ixia.xml:lang}}">
    <title>{{ixia.title}}</title>

When a user creates a map, the variables that appear in the map template are replaced by the values the user enters in the Template Variables table. For example, the {{AuthorName}} variable is replaced by the value John Doe during map creation.

If you wanted to specify the allowed values in the Values column, you first need to define a parameter in the templateparameters.xml configuration file. The parameter can specify whether it is a mandatory or optional value and whether the allowed values are in the form of a list, date, or text. Once a parameter is defined, user can use it in the map template.

For example, if you have a parameter called AuthorList in templateparameters.xml that is defined as a list of author names with the Author label, replace the AuthorName variable from the previous example with the AuthorList parameter instead.

<bookmeta>
			<author>{{AuthorList}}</author>		
</bookmeta>
Figure: Example of using a parameter in the Create Map dialog box
Screenshot of the map template using a parameter

As with variables, parameters in the map template get replaced with the user-entered value or user-selected value from the Template Variables table. For example, the {{Author}} parameter is replaced by the value Smith, Jane during map creation.