The content reference (conref) attribute

The conref feature allows DITA content to be used in any number of different places in a collection. The conref attribute in a referencing topic specifies the source topic and the element within that topic to re-use.

In DITA, content can be re-used at the topic level (by using one topic in many ditamaps), at the block level, or at the phrase level. Any DITA element, be it a paragraph, a table, a task pre-requisite, a user interface control, a term, a cross-reference, or any other tagged chunks, can be re-used elsewhere. The mechanism for block and phrase level re-use is the content reference, or conref.

The key to content referencing, or transclusion, is the ability to identify a chunk of content using a simple naming structure.

A content reference is specified by entering the address of the content to be re-used in the conref attribute of the element into which it will be included or transcluded. The conref attribute value has the following syntax:


where topicfilename is the file name of the topic containing the content to be transcluded, topicid is the id attribute of the topic, and elementid is the id attribute of the element to be re-used. (This naming convention is also used for cross-referencing and other types of linking.)

For example, if the source of the content to be transclude is a paragraph (p) element with an id attribute of intercooler_temperature, in a topic with a file name of c_intercooler.dita and an id attribute of concept_turbo_intercooler, then the referencing paragraph element will be coded as:
<p conref="c_intercooler.dita#concept_turbo_intercooler/intercooler_temperature"/>

The conref idea originated in SGML.