Cross-referencing topics outside a map

Having trouble installing Oxygen? Got a bug to report? Post it all here.
antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

Cross-referencing topics outside a map

Post by antoterrence »

Hi,
We have a couple of maps that include topics which in turn contain cross-references to topics that are not part of the maps.
Is it a good practice to cross-reference topics that are not part of a map? If done, such cross-references will work only in HTML output and not PDF.
Can you guide us on a good strategy to cross-reference topics in DITA?

Regards,
Antony Terrence
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Cross-referencing topics outside a map

Post by Radu »

Dear Antony,

As you also found out, using such cross references results in broken links in the PDF output. So links to topics not referenced in the DITA Map is not a good idea.
In the Oxygen DITA Maps Manager view there is a "Validate and Check for Completeness" and one of the checkboxes there is "Report links to topics not referenced in the DITA Map". You should use that to avoid having such problems in your DITA project.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

Re: Cross-referencing topics outside a map

Post by antoterrence »

Thank you, Radu. The topic that contains cross references is being reused. So in one map, it works fine. In another, the writer does not want the links to appear in the output except the xref text. Is there a way to disable link (blue line) from the output without removing the xref element? Thanks for your help.
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Cross-referencing topics outside a map

Post by Radu »

Hi Antony,

I would do this using key references.
So in the reusable component topic I would have the link something like this:

Code: Select all

<ph keyref="linkKey"/>
and then in the DITA Map where I want it as link, I would define the key like this:

Code: Select all

<keydef keys="linkKey" href="tasks/pruning.dita"/>
then in the other DITA Map where I want plain text I would define it like this:

Code: Select all

<keydef keys="linkKey">
    <topicmeta>
      <keywords>
        <keyword>
          LINK TEXT HERE
        </keyword>
      </keywords>
    </topicmeta>
  </keydef>
I tested this with the DITA OT 3.x bundled with Oxygen 21.1, it may not work with older DITA OTs.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

Re: Cross-referencing topics outside a map

Post by antoterrence »

Thanks. It works.
Post Reply