Creating a DITA Content Key Reference

DITA Content Key Reference

A DITA content key reference, or conkeyref, is a mechanism for inserting a piece of content from one topic into another. It is a version of the DITA content reference mechanism that uses keys to locate the content to reuse rather than direct references to topics that contain reused content.

As with a conref, a conkeyref requires that the element to be reused has an id attribute. It also requires the topic that contains the reusable content to be assigned a key in a map. As with all uses of keys, you can substitute multiple maps or use profiling to create more than one definition of keys in a single map. This allows the same conkeyref to pull in content from various sources, depending on how your build is configured. This can make it easier to create and manage sophisticated content reuse scenarios.

Creating a Content Key Reference

To create a content key reference (conkeyref), follow these steps:

  1. Make sure the topic that contains the reusable content is assigned a key in the DITA map and the element you want to reference has an id assigned to it.
  2. In Author mode, place the cursor at the location where you want the reused content to be inserted.
  3. Select Reuse Content on the main toolbar (or from the DITA menu or Reuse submenu of the contextual menu). The Reuse Content dialog box is displayed.
  4. Select the Key radio button for the content source and use the Choose Key Reference button to select the key for the topic that contains the reusable content (you can also select one from the drop-down list in the Key field). The elements that you can reference from the source are presented in the table in the middle of the Reuse Content dialog box.
  5. Select the Element ID of the element (or elements) that you want to insert, and verify the content in the Preview pane. The id value of the element that you select is automatically added to the Reference to (conkeyref) field.
  6. Make any other selections you need in the Reuse Content dialog box. If you select multiple elements, the Expand to (conrefend) field is automatically filled with the id value of the last element in your selection.
  7. Click Insert or Insert and close to create the content reference.