Insert a cross-reference (xref) to an element within the current topic using the XMetaL editor
This procedure uses the XMetaL editor to set up a hypertext link within a topic.
Sometimes you may want to create hypertext jumps within the current topic. You might, for example, have a bulleted list at the top of the topic, and you'd like to link each item to a corresponding section farther down the page.
- Assign an ID to the target element.
- Write an xref around the text where you want your hypertext link to appear. You'll use the target element's ID in this xref.
Say you've written a topic like the one shown below, and you wanted to
link each item in the bulleted list to the appropriate section.
In the opening tag of the target element – the element you want to jump to – insert an ID
You'll use the Attribute Inspector to do this.This example shows what you'd see if you assigned the string "ducksid" to the section "About Ducks".
Highlight the word or phrase where you want to insert the xref.
In this case, you'll highlight the word "Ducks" in the bulleted list.
- Use Search to display topics in the Search Results view.
Right-click any topic, then select
from the menu.Note: This inserts an XML cross-reference (xref). You'll need to edit its attributes so that it references the target text.
- Place your cursor on the newly created <xref>.
- Open the Attribute Inspector.
In the <xref> tag's
href attribute, type the location you want to reference.
An intra-file xref uses the following syntax:
- topicid is the root ID of the topic
- idstring is the ID of the target element
The following screen shot shows what the completed href attribute should look like.