Topic reference
A topic reference is the mechanism for referencing a topic (or another resource) from a DITA map. It can nest, which enables the expression of navigation and table-of-content hierarchies, as well as containment hierarchies and parent-child relationships.
Syntax
The syntax for representing this component varies depending on the authoring format:
| Authoring format | Syntax and example |
|---|---|
| XDITA |
|
| HDITA |
|
| MDITA |
|
Attributes
The available attributes vary based on the authoring format:
- XDITA and HDITA
- The following attributes are available on this element: ID
attributes, link relationship attributes, localization attributes, universal
attributes,
@keys,@keyref, and@props. - MDITA
- For the MDITA core profile, the equivalent
of the XDITA
@keyrefattribute is supported. For the MDITA extended profile, attributes can be specified by using the HDITA representation.
Examples
This section contains examples of how the topic reference component can be used.
The following code sample shows a simple DITA map that represents
the Acme Widget User Guide. Each of the
<topicref> elements represents the
top-level topic for a chapter, and indirect addressing is used to
reference the DITA topics.
map>
<topicmeta>
<navtitle>Acme Widget User Guide</navtitle>
</topicmeta>
<keydef href="key-definitions.ditamap"/>
<topicref keyref="installing">
<!-- … -->
</topicref>
<topicref keyref="configuring">
<!-- … -->
</topicref>
<topicref keyref="administering">
<!-- … -->
</topicref>
<topicref keyref="developing">
<!-- … -->
</topicref>
<topicref keyref="troubleshooting">
<!-- … -->
</topicref>
</map>
The following code sample shows a simple DITA map that represents the Acme Widget User Guide. Each of the topic reference components represents the top-level topic for a chapter, and direct addressing is used to reference the HDITA topics.
<ul>
<li><a href="installing.html">Installing Acme Widget</a>
<! ... -->
</li>
<li><a href="configuring.html">Configuring Acme Widget</a>
<! ... -->
</li>
<li><a href="administering.html">Administering Acme Widget</a>
<! ... -->
</li>
<li><a href="developing.html">Developing Acme Widget applications</a>
<! ... -->
</li>
<li><a href="troubleshooting.html">Troubleshooting Acme Widget</a>
<! ... -->
</li>
</ul>
The following code sample shows a simple DITA map that represents the Acme Widget User Guide. Each of the topic reference components represents the top-level topic for a chapter, and direct addressing is used to reference the MDITA topics.
- [Installing Acme Widget](installing.md)
<!-- ... -->
- [Configuring Acme Widget](configuring.md)
<!-- ... -->
- [Administering Acme Widget] (configuring.md)
<!-- ... -->
- [Developing Acme Widget apps (developing.md)
<!-- ... -->
- [Troubleshooting Acme Widget (troubleshooting.md)