Use content key references

If you want to reference re-useable content many times, using the key reference is easier to update than a content reference. Keys are useful because the link is connected to the content in one place in the map, which makes it easier to update than a conref that uses a file name to find the content.

You can use keys to define resources (for example, URIs, metadata, or variable text strings) at the DITA map level instead of locally in each topic.

You need the following files to add a link using a key:

  • A reusable topic
  • A DITA map that lists the reusable topic
  • A component that uses the reusable content

In your map, when you add a link to the content you want to reuse, you define a word as a key. Then, in your topic, you link to that key word. This way, if you need to change the referenced content, you only have to change your map file, rather than change every place you've referenced the content in your topics.

For example, in your map, add a link to the content you want to reuse, and define a key word:

<topicref href=global_definitions.dita keys="dictionary"/>

Then, in your topic, to insert the linked content, just use the key:

<xref keyref="dictionary"/>