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). Because of that, context maps are also referred to as warehouse maps.

When you set a map as a context map, references added in topics with, for example, keyref or conkeyref, are resolved (replaced with content) based on the keys in the context 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 this 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 present, the conkeyref is not referencing any content.

Topic with unresolved conkeyrefs vars/productName

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 key as Classic Toaster.

Topic with conkeyrefs vars/productName that resolve to value 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 Lightning Toaster.

Topic with conkeyrefs vars/productName that now resolve to value 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

Important Considerations

  • Context maps are also called warehouse maps as they contain warehouse content to resolve variables added with key references keyref or content key references conkeyref.

  • You can apply context maps to content in two ways: by setting it in the Context menu and by attaching it to a deliverable map.

    When you set it in the Context menu menu, you can easily switch between different context maps but you also need to set a context map every time you open a deliverable map. For more information about context maps in the Context menu, see Set a Context Map.

    When you attach it to a deliverable map, switching between context maps is not as easy because it requires you to modify your deliverable map to use a different context map. On the other hand, with a context map attached to your deliverable map, your variables resolve as soon as you open your deliverable map. For more information about attaching your context map (or warehouse map) to a deliverable map, see Add a Warehouse Map with Conkeyrefs to a Deliverable Map.

  • When used in the Context menu, context maps need to be set every time a resource is opened in the Content Editor.

  • Previewing PDF Generator output for a deliverable map with a context map set in the Context menu generates a preview with unresolved variables. This is a known limitation. However, previewing individual topics with a context map set in the Context menu resolves variables.

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.