XML technologies / DITA / Creating and organizing topics / Navigation in topics

(Excerpt from “DITA – Der neue Standard für Technische Dokumentation” by Johannes Hentrich)

DITA offers three ways to navigate between topics
using links:

Ordinary and related links are defined in topics. Relationship tables are available in maps and bookmaps. Information about relationship tables is provided in Relationship tables.

Links

The element <xref> lets you create links:

  • to other topics,

  • to elements in other topics,

  • to elements in the same topic,

  • to external sources.

Specify the link target in the attribute href.

A link to another topic is defined with

<xref href="zieltopic.xml">Link zu Topic</xref>

The text in the element <xref> is used as the link text. The attribute type can also indicate a property of the target. Values for the attribute type are concept, task, reference, topic as well as fig, table, li, fn and section.

To link to an element in another topic, you must know both the topic’s ID and the element’s ID. A link is then created as follows:

<xref href="zieltopic.xml#topicid/elementid">Link zu Element in einem Topic</xref>

The path to the target file is followed by a hash sign (#), then the topic’s ID, separated by a slash (/) from the element’s ID.

To link to an element in the same topic, you also need the topic’s ID and the element’s ID. The link is then defined as follows:

<xref href="#topicid/elementid">Link zu einem Element im selben Topic</xref>

A link to an external source requires its URL. You can then create the link as follows:

<xref href="http://www.xlcontent-verlag.de">XLcontent Verlag</xref>

Related links

At the end of a topic, the element <related-links> lets you insert a list of links to other topics or external sources related to the current topic. The element <related-links> is placed after the element <body> or its equivalents in the other topic types.

<concept id="kapitel8_concept">
    <title>...</title>
    <conbody>
        ....
    </conbody>
    <related-links>
        ....
    </related-links>
</concept>

A link is defined in the element <link>. Linking through the attribute href works as it does for the element <xref>.

<related-links>
    <link href="uerblick.xml"/>
</related-links>

Link text is generated only when the DITA Open Toolkit processes the DITA XML files. If possible, it uses the target topic’s title. However, the element <linktext> lets you define alternative link text. In particular, when linking to an external URL, you should use the element <linktext>.

<a href="http://href=&quot;http://www.xlcontent-verlag.de&quot;">
    <linktext>Informationen zum XLcontent Verlag</linktext>
</a>

Links can be grouped in two ways: with the element <linkpool> and with the element <linklist>.

The element <linkpool> groups links with similar subject matter. The attribute type can specify the relationship between the topics more precisely.

<related-links>
    <linkpool type="task">
        <link href="database_install.xml"/>
        <link href="server_install.xml"/>
        <link href="program_install.xml"/>
    </linkpool>
</related-links>

For the element <linkpool>, links are sorted when the DITA XML files are processed by the DITA Open Toolkit. Sorting is determined by the attributes used in the links, for example the attribute type.

The element <linklist> also groups links by subject, but the output preserves your specified order. The attribute collection-type specifies the relationship between topics in the element <linklist>. The following values are possible for the attribute collection-type:

  • unordered: the value unordered indicates that topic order is not important for understanding. This is the default.

  • sequence: the value sequence indicates that the order of the topics specified in the links is important for understanding.

  • choice: the value choice indicates that one of the topics should be selected.

  • family: the value family indicates that the topics listed in the links are related not only to the current topic but also to one another.

<related-links>
    <linklist collection-type="familiy">
        <link href="database_install.xml"/>
        <link href="server_install.xml"/>
        <link href="program_install.xml"/>
    </linklist>
</related-links>

The element <linklist> also has the element <linkinfo> available. Here you can add further information about a list of links.

<related-links>
    <linklist collection-type="familiy">
        <link href="database_install.xml"/>
        <link href="server_install.xml"/>
        <link href="program_install.xml"/>
        <linkinfo>Informationen zur Installation der Entwicklungsumgebung</linkinfo>
    </linklist>
</related-links>

  

 

 

 

back to top