conref(), conkeyref() annotations

Table of Contents

Syntax #

conref((key=keyname)(id-for-the-library=libraryid)(filename=filename)(content=texttoconref)(topic-type=type))

key

short label used to identify the text being referenced

id-for-the-library (optional)

the file ID for your conref file

filename (optional)

name for your file; this file will be included in your DITA output

content (optional)

the text that will replace the conref in the published document

topic-type (optional)

type of topic for your library file

conkeyref((key=keyname)(id-for-the-library=libraryid)(filename=filename)(content=texttoconkeyref)(topic-type=type))

key

short label used to identify the text being referenced

id-for-the-library (optional)

the file ID for your conkeyref file

filename (optional)

name for your file; this file will be included in your DITA output

content (optional)

the text that will replace the conkeyref in the published document

topic-type (optional)

type of topic for your library file

If you use the argument topic-type, you must also use the argument id-for-the-library in your annotation.

Purpose #

These commands operate in a similar way; they allow you to easily reuse content. The difference between a conref and a conkeyref is in how the content being brought into your document is referenced, or located.

A conref requires a URI-based, or direct, reference to the content being pulled in. (For more information on URI-based addressing, please see the DITA specification for URI-based addressing.) For example, using a conref to replace the variable CompanyName with the company name Birds Eye Inc would give you a rule that looks like this:

Rule to add a conref

You will get output in your topic that may look like the following:

<p>
  Words and logos marked with ® or ™ are registered trademarks or 
  trademarks owned by 
  <ph conref="BirdsEyeConrefs.dita#BirdsEyeConrefs/CompanyName">
    Birds Eye Inc
  </ph>.
  Other brands and names mentioned herein may be the trademarks of 
  their respective owners.
</p>

A conkeyref uses an indirect method to access the content being pulled in. Using a conkeyref to replace the variable CompanyName with the company name Birds Eye Inc would give you a rule that looks like this:

Rule to add a conkeyref

This may give you the following output in your topic:

<p>
  Words and logos marked with ® or ™ are registered trademarks or 
  trademarks owned by
  <ph conkeyref="BirdsEyeConrefs/CompanyName">
    Birds Eye Inc
  </ph>. 
  Other brands and names mentioned herein may be the trademarks of 
  their respective owners.
</p>