Under maintenance

Heretto Help

Show Page Sections

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/productNamee 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.

Figure 1. Example of a context map
Example of a context map

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.

Create a context map:

Set your context map in the Content Editor. See Set a Context Map.

Set a Context Map

Set a context map for a topic or map to resolve dependencies like key references (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.
  1. Open a map or a topic and from the Context drop-down menu, select Select a context map.
    Figure 2. Context Menu for a topic
    Context Menu for a topic
    Figure 3. Context Menu for a Map
    Context Menu for a map
    Note:
    • For maps, the default context map is the map to you are currently editing. If your map contains a warehouse map, that warehouse map is automatically used as the context map and you do not need to set a context map manually.

    • For topics, no context map is set by default.

  2. Navigate to and select a map.
  3. Click Select.

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.