Excluding topics from the output TOC

When generating an output which includes a TOC, you may want to generate a topic from your ditamap but not have it appear in the output TOC. This is achieved through the toc and linking attributes of the topicref.

By default, every topic referenced in the ditamap will be included in the output, regardless of whether it is referenced in the hierarchy section of the map or the reltable section of the map.

There will be cases where a topic in your collection should not appear in the output TOC. An example may be where you have a topic containing an example, which you will reference from a concept topic. You may arrange the topic hierarchy so that the example topic is a child of the concept topic. You want a link to be automatically generated from parent to child, based on the hierarchy, but you don't want the example topic to appear as the sole child of the concept topic in the TOC.

To exclude the topic from the output TOC, you must set the relevant topicref element's toc attribute to no.

An example of the mark-up is:
<topicref
  format="dita"
  href="Reference/FeatureComparisonTable.dita"
  navtitle="Features in different versions of World Time Pro"
  scope="local"
  type="reference"
  linking="yes"
  toc="no" />

If you do not want the parent-child link to automatically generate (because you want to link manually, or through a reltable relationship), you must set the hierarchy topicref element's linking attribute to none.

Note:
If you want to entirely exclude a topic included in a ditamap from the output, you should delete from the ditamap all topicref elements linking to that topic, including any in the relationship table. If you are using conditional publishing, you can set the filtering metadata attributes (such as <topicref audience="administrator"... />) on all topicref elements linking to the topic to be filtered during the publishing process.