Variable Reuse
Variables enable you to easily reuse and update content like a product names, interface terms, or other items that might change either because they're being used in different contexts or because of external changes like rebranding.
Variable Reuse Methods
You can reuse variables by using conkeyref attributes or keyref attributes. However, we recommend reusing variables with conkeyref attributes. Whatever method you choose, use it consistently.
Variable Reuse with Conkeyrefs | Variable Reuse with Keyrefs |
---|---|
Can be fully managed through a dedicated graphical user interface in Heretto CCMS. | Cannot be fully managed through a dedicated graphical user interface in Heretto CCMS. You may need to use the Source Editor to edit DITA code. |
Contained in variable warehouse topics. | Contained in variable warehouse maps. |
Involves conkeyref attributes. | Involves keyref attributes. |
Involves phrase elements. | Involves keyword elements. |
Localization Considerations
If you localize content or plan to localize content, keep the following considerations in mind while using variables:
- In some languages, words change form depending on their role in the sentence. Because the text in the variables forms a part of the grammatical structure of the sentence, using a variable in sentences with different grammatical structures can introduce unintended errors in the target language.
- You can safely use non-grammatical items for variable content. For example, it is rather safe to translate variable content like phone numbers, addresses, hours of operation, or external links.
Variable Reuse with Conkeyrefs
You reuse variables from variable warehouse topics with conkeyref attributes.
Overview
- The “Variables Warehouse” topic is added to the deliverable “Map A” through the keydef element with the
@keys
attribute assigned.Important: Including variable warehouse topics through the keydef element with the@keys
attribute assigned is necessary for the variable reuse mechanism to operate properly. By default, keydef elements are not included in the output. - “Variable A” is used in “Element A” in “Topic A”.
- “Variable B” is used in “Element A” and in “Element D”. The elements are in different topics.
Example
The following examples show the variable reuse mechanism through conkeyref attributes in Heretto CCMS. The Content Editor indicates reused variables with gray background.
Create a Variable Warehouse Topic
Create a variable warehouse topic that contains variables for product names, interface names, etc.
Add Variable Warehouse Topics to Maps
Add a variable warehouse topic to a map as a keydef element to enable variable reuse through content key references (conkeyrefs).
Reuse Variables through Conkeyrefs
You reuse variables from the variable warehouse topics through phrase elements and conkeyref attributes.
- Open a map with a topic in which you want to reuse a variable.
- Navigate to the topic that you want to insert the variable in.
- Place your cursor where you want to insert the variable.
- Open the Con/Keyref drop-down menu by pressing (Mac) or (Windows).
-
Do any of the following:
- If you know the variable ID, begin entering the ID.
Heretto CCMS automatically highlights the closest match.
- If you don't know the variable ID, find the variable by browsing the list.
- If you know the variable ID, begin entering the ID.
- In the list, double-click the variable that you want to insert.
Variable Reuse with Keyrefs
You can reuse variables from variable warehouse maps with keyref attributes.
Overview
- The “Warehouse Map” is added to the deliverable “Map A” through the mapref element with the
@processing-role="resource-only"
attribute assigned. - “Variable A” is used in “Element A” in “Topic A”.
- “Variable B” is used in “Element A” and in the “Element D”. The elements are in different topics.
Example
The following example shows the variable reuse mechanism through keyref attributes in Heretto CCMS. The Content Editor indicates reused variables with gray background.
Create a Variable Warehouse Map
Create a variable warehouse map that contains variables for product names, interface names, etc.
Add Variable Warehouse Maps to Deliverable Maps
Add a variable warehouse map to a deliverable map to enable variable reuse through keyword elements and keyref attributes.
Reuse Variables through Keyrefs
You reuse variables from the variable warehouse maps through keyword elements and keyref attributes.
- Open a map with a topic in which you want to reuse a variable.
- Navigate to the topic that you want to insert the variable in.
- Place your cursor where you want to insert the variable.
- Open the Con/Keyref drop-down menu by pressing (Mac) or (Windows).
- Do any of the following:
- Begin entering the variable
@keys
attribute value.Heretto CCMS automatically highlights the closest match.
- Find the variable by browsing the list.
- Begin entering the variable
- In the list, double-click the variable that you want to insert.