Related links point to wrong topic sequence when using reusables

Post here questions and problems related to editing and publishing DITA content.
Sergio_7
Posts: 4
Joined: Fri Sep 15, 2023 9:56 am

Related links point to wrong topic sequence when using reusables

Post by Sergio_7 »

Hi team,
I have a problem with related links when using reusable elements:
When I create related links to topic 1 and topic 2 (both the same reusable topic) and click on topic 2, I always jump to topic 1 in the sequence.
Could you please help me to fix this problem? My project example is attached here.

Steps to reproduce the problem:
1. Export the ditamap as HTML output.
2. Navigate to the chapter "General Description" and click on the corresponding link "Connecting the System" under the title "System 2".
3. Expect to be redirected to the System 2 topic ("connecting-system-2.html") in the navigation structure.
Observe that you are in the System 1 chapter ("connecting-system.html").
image.png
image.png (35.8 KiB) Viewed 281 times
image.png
image.png (5.56 KiB) Viewed 281 times

Please find attached the project example.
XML-Oxygen_Related_Links.zip
(2.41 KiB) Downloaded 21 times
Radu
Posts: 9084
Joined: Fri Jul 09, 2004 5:18 pm

Re: Related links point to wrong topic sequence when using reusables

Post by Radu »

Hi,
The DOCTYPE of your DITA Map seems to define it as a DITA 2.0 map although the DITA 2.0 standard has not yet been released:

Code: Select all

<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA 2.x Map//EN" "map.dtd">
Is there a reason for this?
Other than that the DITA OT publishing engine needs some additional help to know to what instance of the topic you want to link.
If the DITA Map was not of version 2.0, I would have maybe used copy-to on each topicref like:

Code: Select all

<topicref href="reusables/connecting-system.dita" collection-type="sequence" copy-to="reusables/connecting-system-1.dita"/>
and then link directly to the copy-to version of each topic.
Or you can create actual live topic files on your hard drive for each instance, and each topic has a conref to the topic in the "reusables" folder.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Sergio_7
Posts: 4
Joined: Fri Sep 15, 2023 9:56 am

Re: Related links point to wrong topic sequence when using reusables

Post by Sergio_7 »

Hi Radu,
Thank you for your quick reply.

I have tested the "copy-to" feature with older DITA standard and it works.
I created a key for the topic that I wanted to reuse and achieved it with the copy-to element:

Code: Select all

<topicref keys="connecting-system-2" href="reusables/connecting-system.dita" copy-to="connecting-system-2.dita"/>
I then simply refer to the key in the related links:

Code: Select all

 <link keyref="connecting-system-2"/>
I wonder why the DITA 2.0 does not support this feature if the resolution of related links does not work properly by default (without "copy-to").

The suggestion regarding "conref" needs live files (as you said). But my intention is not to create unnecessary files if they are not needed.

Thanks for your help and effort!
BR
Last edited by Sergio_7 on Wed Apr 10, 2024 1:54 pm, edited 3 times in total.
Radu
Posts: 9084
Joined: Fri Jul 09, 2004 5:18 pm

Re: Related links point to wrong topic sequence when using reusables

Post by Radu »

Hi,
From what I understand the DITA 2.0 standard will have an equivalent to copy-to:
https://blog.oxygenxml.com/topics/dita_ ... sheet.html
But the publishing engine does not support that yet so I guess you would need to wait on this one.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply