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 “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 a key icon and a gray background.
- The companyName variable is used in “Topic A”
- The productName variable is used in “Topic A” and “Topic B”
- The variables are reused from “Variable Warehouse Map” through keyref attributes and keyword elements
Create a Warehouse Map with Keyrefs
Create a variable warehouse map that contains variables for product names, interface names, etc.
We recommend grouping similar variables in dedicated variable warehouses. For example, keep your product name variables and interface variables in separate variable warehouses. This strategy prevents your variable warehouses from becoming very large, cluttered, and disorganized as you add new reusable elements over time.
Add a Warehouse Map with Keyrefs to a Deliverable Map
Add a variable warehouse map to a deliverable map to enable variable reuse through keyword elements and keyref attributes.
If you do not want to add your warehouse maps to your deliverable maps, you can skip this procedure and set your warehouse maps as context maps. See Set a Context Map.
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 in which you want to insert the variable.
- 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
- Use your keyboard keys or mouse to select and insert a variable.