Variables
Variables are placeholders inside your XML documents which are replaced by a text string or graphic at publishing time.
When to use variables
Some data may vary when writing documentation for a specific product family. For example, the product name, the customer name, the product logo may be the only difference in the data. To increase reuse, it is recommended that you use variables to indicate these differences.
Variables can be used for:
- textual values - for example, brand name, a text that is seen in the display of the equipment or e-mail addresses for where to get support.
- numerical values - for example, year in copyright texts, version number of a software release, or an emergency number.
- graphics - for example, company logo, or product logo in case of multi-branding.
Using variables allows you to published from the same XML source.
The structure of variables
Each variable has a unique ID that uniquely identifies that variable. This ID is called the varid. While the value of the variable may change between publications, the variable names inside the documentation are static and always remain the same.
...
<para>Welcome to the <variable varref="product-name"/>
documentation center</para>
<para>This is a <variable varref="company-name"/> product</para>
...
...
Welcome to the Content Manager documentation center
This is an SDL product
...
...
Welcome to the Content Delivery documentation center
This is an SDL Structured Content Technologies Division product
...
How variables are stored
Content Manager stores variable values in topics. Preferably these are topics stored in a Library. In the topic, the variable names are mapped to a text string or graphic. The topic is associated with a publication as a Resource. The resources are used at publication time, or when previewing, to dynamically replace the variables with the valid text string or graphic.
Variables and translation
Variables can be translated the same way other objects are translated in Content Manager.