Insert variables in your XML objects as placeholders for changeable content. For example, when creating the same publication for different brands of the same product, you can assign a different value for the variables such as a brand name or a company logo.
About this task
The values for the variables at publish time are extracted from one or more library topics that are associated with the publication. Different libraries can be defined for different publications. The libraries contain the same variables but with different content for each publication. To ensure that you use the correct identifier for a variable, you pick it from a library topic.
Note: If a variable is used inside a variable, there is currently no predicting the order of resolution of the variables for every XML editor and this leads to unexpected results. Therefore the use of variables inside variables is not supported.
Procedure
- In your authoring tool with the object open for editing, place the cursor in a location where you can insert a variable.
- Select .
The Insert Variable window is displayed.
- Navigate to the library in which the variable is defined then click Select.
A preview of the library appears where you select a variable by clicking on it. The selected variable is distinguished by a colored border.
- Select the variable you want to insert then click OK.
The preview dialog closes and the address field is populated with the identifier of the variable.
- Click OK to close the Insert Variable window.
What to do next
Please note when previewing or when editing objects that contain variables, the values of the variables are not synchronized within the context of the publication. This is because an object can be used in many publications that have different contexts. You may see variable values that seem incorrect but be assure that the correct values for the variable are used at publication time.