Adding variables to a map template

You can add variables or parameters to the map template to provide fields into which users can enter values at map creation.

To create a variable into which the user can enter a value, 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 users to provide when they create a map, as follows:

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

When the 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, the users will see AuthorName in the Template Variables table, and they will be able to enter any string of characters they want 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 the map is created, the variables that appeared in the map template are replaced by the values the user entered in the Template Variables table. For example, the {{AuthorName}} variable is replaced by the value John Doe when the map is created.

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, it can be used 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 a label called Author, you could replace the AuthorName variable given in 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 is done with the variables, the parameters in the map template are replaced by the value entered or selected by the user in the Template Variables table. For example, the {{Author}} parameter is replaced by the value Smith, Jane when the map is created.