Adding relationships

Last Updated : Nov 04, 2024 |

Relationship tables define the relationships between topics. Each row or the Relation element in the relationship table represents a relationship. The links appear in the output at the bottom of each topic as related links.

About this task

You can add relationships between topics using a relationship table in the map. If you are using the same relationship table in a DITA map and a bookmap, you can reuse the relationship table rather than create it in both places or copy it from one to the other.

You can create relation between two or more topics of any type. However, you must group topics that you want to relate using the topic group element. A topic group under a Relation element must contain topics of same topic type.

Note:

Relationship table links do not work from topics that are the first or only topic in a chapter or appendix.

Before you begin

Create a DITA map or bookmap.

Procedure

  1. Open the publication in Publication Manager.
  2. Check out the map where you want to create or modify the relationship.
  3. To add a relationship to the relationship table:
    1. Expand an empty row in the Relationship Table element, or, if the table does not contain empty rows, right-click the Relationship Table element, and then click Add Within > Relationship Row.

      A Relation element indicates a row or a relation. A relation element or a row contains a relation element for each topic type, such as Relation task, Relation concept, and Relation reference.

      Note:

      Add topic of type that match with the Relation element. For example, add all task topics under the Relation task element and set the link attribute to each topic.

    2. Right-click the Relation element that matches the topic type of the topic that you want to add, and then click Add Within > Topic Ref.

      For example, to add a task topic to the relationship table, right-click the Relation task element, and then click Add Within > Topic Ref.

    3. Click Browse, and then browse to and select the topic to add to the relationship.
    4. In the Linking field, set an attribute to the topic.
      • Target only: To link the topic from other topics in the relationship but prevent the topic from linking to other topics in the relationship.

        With Target only, other topics in the relationship does not appear in the current topic as related topics.

      • Source only: To link other topics in the relationship to this topic but prevent the topic from appearing in other topics.

    5. Click OK.
    6. Repeat steps b through e to specify the topics that are related to the first topic.
  4. To create a relationship between more than one topic of the same type, add a topic group within the Relation element for that topic type, for example, Relation task:
    1. Right-click the Relation element where you want to add the topic group and select Add Within > Topic Group.

      Ensure that you add the topic group to the appropriate Relation element. For example, if you are creating a relationship between two tasks, add the Topic Group to Relation task.

    2. In the Collection type field of the Insert Values of ‘Topic Group’ dialog box, select Family, and then click OK.
    3. Right-click the Topic Group element, and then click Add Within > Topic Ref.
    4. Click Browse, and then browse to and select the topic to add to the Topic Group.
    5. Set any other attributes required for the topic relationship, and then click OK.
    6. Repeat steps c through e to specify other topics in the topic group.
  5. Repeat steps 3 and 4 as necessary to add relationships to the relationship table.
  6. Check in the map.
    Note:

    It’s a really good practice to include an XML comment at the top of topics to indicate any topics they have relationship table links to. This is especially important for topics that are reused so that writers reusing that topic can see the topics the writer is linking to in a relationship table and can set up the same relationships in their maps.

  7. Optional If you want to reference topics that you created links to using a reltable, you can include text references to those topic and wrap the topic title with the <q> element.