How is deep linking to specific sections or topics supported in DITA?
Deep linking to specific sections or topics in DITA is a valuable feature that allows you to create direct links to a precise location within a document, even if it’s within a larger topic. This is particularly useful for referencing specific pieces of information or creating cross-references to enhance the user’s navigation and understanding.
Deep Linking in DITA
To support deep linking in DITA, you can use the <xref> element. The <xref> element allows you to link to a specific location within a DITA document or topic. It includes attributes like “href” to specify the target, “format” for the link format (e.g., “dita” or “pdf”), and “scope” to define the scope of the link (e.g., “local” or “peer”). When using the <xref> element, you can provide detailed context for the link to guide users to the right place.
Example:
Here’s an example of how to create a deep link to a specific section in DITA:
<xref href="user-guide.dita#section-3.2" format="dita" scope="local">Click here for details on advanced settings.</xref>
In this example, the <xref> element is used to create a deep link to the “section-3.2” within the “user-guide.dita” document. Users clicking the link will be taken directly to the specified section, improving their content navigation experience.