Page 1 of 1

Cross-referencing topics outside a map

Posted: Thu Jul 25, 2019 12:36 pm
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

Re: Cross-referencing topics outside a map

Posted: Thu Jul 25, 2019 2:50 pm
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

Re: Cross-referencing topics outside a map

Posted: Thu Jul 25, 2019 4:43 pm
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.

Re: Cross-referencing topics outside a map

Posted: Fri Jul 26, 2019 8:35 am
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

Re: Cross-referencing topics outside a map

Posted: Wed Aug 21, 2019 7:01 pm
by antoterrence
Thanks. It works.