Add a Cross-Reference to an Element in a Specific Fork
This article is designed to help you when all of the following apply:
-
You have reused the same topic several times in the same publication
-
You want to add a cross-reference to a specific element in the reused topic
-
You want the cross-reference to target a specific instance of the topic, rather than the first instance.
Note
Each time a topic appears in a publication, we call it an "instance" of that topic. For each instance, the publication has a separate reference, called a fork.
For example, let's say you have reused a "Reset system" four times in the same publication. You want to add a cross-reference to a para element in the "Reset system" topic, but you specifically want to target the fourth instance of the topic and not the other three. For that, you need to add a cross-reference to a specific
element (para
) for a specific fork (fourth topic instance).
The following steps explain how to set up a cross-reference to an element in a specific instance of a topic:
-
The element that you are going to cross-reference needs to have an
xml:id
attribute, otherwise you will be unable to reference it.To check if the target element has an
xml:id
:-
Open the topic that contains the target element.
-
Click inside the target element.
-
Look in the Element attributes side panel. If the element has an
xml:id
, it will be listed there.
To learn how to create an xml:id for an element, see Manually Generate IDs for Cross-references.
-
-
Open the topic that will contain the cross-reference.
-
Position the cursor where you want the cross-reference to appear.
-
Select the Insert tab.
-
Select Link and choose Cross-reference in the toolbar.
-
Enter a Link label. [Optional].
-
Navigate to the publication.
Note
The cross reference dialog shows the targets both as part of the publication and as topic (outside the publication tree). It is important to select the one in the publication tree to get the
fork link
!Learn the difference between topics and forks, see Topic or Fork.
-
Open the publication branch and navigate to instance of the topic that has the target element. For example, to link to the fourth instance of a topic, navigate to the fourth instance inside the publication structure.
-
Select the arrow in front of the topic to see linkable elements.
-
Select the target element to add a cross-reference to it in your topic.
-
Select the link in the topic and look in the Element attributes panel. You should see that the link has an
xlink:href
attribute.The value for the attribute should have this structure:
urn:resource:fork:<fork id number>/<element>-idm<element id number>
For example:
urn:resource:fork:1665535/para-idm243468712643086
If your link does not use this structure or has no link at all, repeat this procedure and make sure you:
-
Navigate to the topic instance inside the publication and not directly to the topic itself
-
Link to the element in the appropriate instance of the topic.
-
-
Select Save.
Note
When you publish to PDF, cross-references to elements in reused topics get the text for the link plus a page number in square brackets.