9.6.5 Directing a content reference to the correct branch

When you include the same topic in more than one place in the output, to pull in content from that topic via conref, you must be able to designate the correct instance; you do this by specifying the map branch. To resolve a conref, DITA2Go applies the same rules as for cross references (see §9.6.4 Directing a cross reference to the correct branch):

  1. If a conref in a named map branch targets another topic in the same branch, the content is pulled from the instance in its own branch.
  2. If a conref is to a topic in a different named branch, you can specify the branch with a conref branch PI marker placed just before the element with the conref:
    <?dtall conrefbranch="branchname" ?>
    

    A conref branch PI applies only to the very next element that has a conref.

If neither of these rules applies, the conref pulls content from the first instance of the topic.

So, to reuse descriptions from the duplicated topics, you can set up the <shortdesc> elements in product_intro.dita as follows:

<concept id="prodintro">
 <title>Name of product with conditional ph 
  elements as needed</title>
 <shortdesc><ph id="description">Text here, with
  conditional ph elements.</ph></shortdesc>
 ...
</concept>

Then:

<p>The following products are described here:
 <ul>
  <?dtall xrefbranch="productA" conrefbranch="productA" ?>
  <li><xref href="product_intro.dita" />: <ph
   conref="product_intro.dita#prodintro/description"/></li>
  <?dtall xrefbranch="productB" conrefbranch="productB" ?>
  <li><xref href="product_intro.dita" />: <ph
   conref="product_intro.dita#prodintro/description"/></li>
 </ul>
</p>

The two <li> elements are identical; the PIs direct each one to its own branch, so they pull in different content based on the conditions applied to those branches.

Previous Topic:  9.6.4 Directing a cross reference to the correct branch

Next Topic:  9.6.6 Limiting the scope of keydefs by branch

Parent Topic:  9.6 Scoping and filtering within maps

Sibling Topics:

9.6.1 Understanding the advantages of filtering in maps

9.6.2 Designating map sections as named branches

9.6.3 Reusing the same topics with different conditions

9.6.4 Directing a cross reference to the correct branch

9.6.6 Limiting the scope of keydefs by branch

9.6.7 Directing a key reference to the correct branch