Context Maps
A context map is a map that contains resources, such as keys, which resolve indirect references created with key references (keyref
) and content key references (conkeyref
).
When you set a map as a context map, references in documents are resolved based on the keys in the map. So, different context maps can resolve references differently based on the keys defined. When there is no context map selected, your key references will not resolve and no content appears.
Let's look at an example of how setting a context map resolves content key references (conkeyref
). In the following example, the conkeyref vars/productName
shows, but the content being referenced does not. This is because only maps contain key names and definitions, so when a context map is not selected, the conkeyref is not referencing any content.
However, once you set a context map, the keys and key references defined in the map are used to resolve the conkeyrefs. For example, selecting m_classic_toaster_user_guide.ditamap
as the context map shows the vars/productName
e key as the Classic Toaster.
If you change the context map, and the keys and key references use the same ID but link to different content, the keys are maintained but the content being referenced changes. For example, selecting _m_lightning_toaster_user_guide.ditamap
as the context map shows the vars/productName
key as the Lightning Toaster.
This is the content of the context map used in this example. You can see that the vars/productName
is defined as Classic Toaster
.
Create a Context Map
Context maps resolve key-based references like content key references (conkeyref
) or key references (keyref
). Both conkeyrefs and keyrefs are reuse mechanisms that enable you to reuse snippets of content (or variables).
You can choose between two types of context maps: context map based on conkeyrefs
and context map based on keyrefs
. If you are unsure which type to choose, see Variable Reuse.
To create a context map with conkeyrefs as the reuse mechanism, see Variable Reuse with Conkeyrefs.
To create a context map with keyrefs as the reuse mechanism, see Variable Reuse with Keyrefs.
Set your context map in the Content Editor. See Set a Context Map.
Set a Context Map
keyref
) and content key references (conkeyref
). The context map remains active until you close the file you set it for. If your deliverable map contains a variable warehouse map, that map is automatically used as the context map.The selected map is used to resolve references when previewing or editing files. For example, if you have variables (conkeyrefs), glossary terms (via keyref), or keyref links in a topic or map that you're previewing or editing, the references will resolve to show the correct content.
The context map stays active until you close the file. You must set a new context map when opening another file.