Creating a Reusable Content Component

Almost any content element in DITA can be made reusable simply by adding an id attribute to it. The DITA content reference (conref) mechanism can reuse any element with an id. However, it is considered best practice not to reuse arbitrary pieces of text out of arbitrary topics due to the management overhead this creates, and the possibility of authors deleting or changing content that is reused in other topics without being aware that the content is reused. Instead, create and manage a separate set of topics that contain topics designed specifically for reuse.

Oxygen XML Editor makes it easy to create reusable content components from existing topic content.

Note:

To ensure that the topic file that contains the reusable component is a valid container for just the reusable content component, without having to include the other elements required by a standard topic type, Oxygen XML Editor creates a specialized topic type on the fly. This specialization is designed to make sure that the content is compatible with the topic type from which it is created.

  1. Select the content you want to make into a reusable component.
  2. Choose DITA > Create Reusable Component....
    The Create Reusable Component dialog box is displayed.
  3. In the Reuse Content field, select the scope of the content to be made reusable. The choices presented are each of the container elements of the current caret position, allowing you to select how much of the current content you want to make reusable.
  4. Add a description. This becomes the title of the topic that contains the reusable component, but is not part of the reusable content. It is just to help you identify the reusable content. It will not become part of your output.
  5. Select whether you want the current content to be replaced by the reusable component. This is recommended, since the point of reuse is to maintain only one copy of the content.
  6. Select a file name and location to save the topic containing the reusable component and click Save. It is considered best practice to save or store reusable components in an area set aside for that purpose.
    If you selected to have your current content replaced by the reusable component, Oxygen XML Editor replaces the current content with a content reference. The content of the content reference will be shown in your current topic, but it will no longer be editable. To see the source of the reusable component, click on the Link icon at the beginning of the inserted content.

You now have a reusable component that you can include in other topics using a content reference or a content key reference.