link

The <link> element defines a relationship to another topic. Links are typically sorted when displayed based on their attributes, which define the type or role of the link's target in relation to the current topic.
The optional container elements for link (<linkpool> and <linklist>) allow authors to define groups with common attributes or to preserve the authored sequence of links on output. Links placed in a <linkpool> may be rearranged or removed for display purposes (combined with other local or map-based links); links in a <linklist> should be displayed in the order they are defined. Refer to those elements for additional explanation.

Contains

Note

These models represent only the default document types distributed by OASIS. Actual content models will differ with each new document type.
Doctype Content model
topic, concept, ditabase, glossary, glossentry, glossgroup, reference, task, machineryTask, learningAssessment, learningContent, learningOverview, learningPlan, learningSummary ( (linktext) (optional) then (desc) (optional) )

Contained by

Doctype Content model
topic (base), topic (technical content), concept, ditabase, glossary, glossentry, glossgroup, reference, task (strict), task (general), machineryTask, learningAssessment, learningContent, learningOverview, learningPlan, learningSummary related-links, linklist, linkpool

Inheritance

- topic/link

Example

<related-links>
  <linkpool type="concept">
    <link href="czez.dita#czez" role="next"></link>
    <link href="czunder.dita"></link>
    <link format="html" href="czover.htm#sqljsupp" role="parent">
      <linktext>Overview of the CZ</linktext>
    </link>
    <link format="html" href="czesqlj.htm#sqljemb">
      <linktext>Working with CZESQLJ</linktext>
      <desc>When you work with CZESQLJ, you need to know...</desc>
    </link>
  </linkpool>
<related-links>

Attributes

Name Description Data Type Default Value Required?
href Provides a reference to a resource. See The href attribute for detailed information on supported values and processing implications. CDATA #IMPLIED No
query This attribute is deprecated. It may be removed in the future. CDATA #IMPLIED No
type Describes the target of a reference. See The type attribute for detailed information on supported values and processing implications. CDATA #IMPLIED No
role The role attribute defines the role the target topic plays in relationship with the current topic. For example, in a parent/child relationship, the role would be "parent" when the target is the parent of the current topic, and "child" when the target is the child of the current topic. This structure could be used to sort and classify links at display time. See The role attribute for information on supported values.

The role attribute values sample and external are deprecated.

(parent | child | sibling | friend | next | previous | cousin | ancestor | descendant | sample | external | other | -dita-use-​conref-​target) #IMPLIED No
otherrole Indicates an alternate role. This value is used when the role attribute is set to other. CDATA #IMPLIED No
format The format attribute identifies the format of the resource being referenced. See The format attribute for details on supported values. CDATA #IMPLIED No
scope The scope attribute identifies the closeness of the relationship between the current document and the target resource. See The scope attribute for more information on values. (local | peer | external | -dita-use-​conref-​target) #IMPLIED No
univ-atts attribute group (includes select-atts, id-atts, and localization-atts groups) A set of related attributes, described in univ-atts attribute group
global-atts attribute group (xtrf, xtrc) A set of related attributes, described in global-atts attribute group
class, outputclass, keyref Keyref provides a redirectable reference based on a key defined within a map. See The keyref attribute for information on using this attribute. Class and outputclass are described in Other common DITA attributes

Was this helpful?