Purpose
The <topicref> element designates a topic (such as a concept, task, or reference) as a link in a DITA map. A <topicref> can contain other<topicref> elements, allowing you to express navigation or table-of-contents hierarchies.
Attributes
Name | Description | Data Type | Default Value | Required? |
---|---|---|---|---|
navtitle | Specifies the title of a container in a toc. | CDATA | #IMPLIED | boolean: no |
id | An anchor point. This ID is the target for references by link, xref, and conref, and for external applications that refer to DITA content.. | ID | #IMPLIED | boolean: no |
href | A hyperlink to an external Web page (URL) or to another topic in
the same file or in another file. The href attribute identifies the destination
of the cross-reference link using conventional URL syntax:href="http://www.xxx.com" format="html" href="myfile.dita" type="concept" (or task, reference, or topic) href="myfile.dita#topicid/figid" type="fig" (or table, fn, or section) href="mything.pdf" format="pdf" |
CDATA | #IMPLIED | boolean: no |
type | Describes the target of a cross-reference and may generate cross-reference
text based on that description. Allowed values are:
Note: Valid types for <link> include topic, concept, task, and reference. Valid types for <xref> also include fig, figgroup, table, li, fn, and section. Note: The values external and local are deprecated for this attribute, and will be removed in later versions of the DTDs. Use the scope attribute instead to specify these linking semantics. |
CDATA | #IMPLIED (Processed as if the target were of type "topic.") | boolean: no |
class | Not for use by authors. If an editor displays class attribute values, do not edit them. The class attribute supports specialization. Its predefined values help the output transforms work correctly with ranges of related content. | CDATA | #IMPLIED | boolean: no |
Example
In this example, there are six topicrefs. They are nested and have a hierarchical relationship. Bats.xml is the parent topic and the other topics are its children.<map title="Bats" Bats <topicref href="bats.xml" type="topic"> <topicref href="batcaring.xml" type="task"></topicref> <topicref href="batfeeding.xml" type="task"></topicref> <topicref href="batsonar.xml" type="concept"></topicref> <topicref href="batguano.xml" type="reference"></topicref> <topicref href="bathistory.xml" type="reference"></topicref> </topicref> </map>