# DITA Best Practices : Linking attribute

Created by Todd Stupnik, last modified on Dec 22, 2014

The linking attribute of the <topicref/> and <relcell/> elements in the ditamap is used to specify the way in which links are generated during publishing.

The <topicref/> element (in the hierarchy section of the ditamap) and the <relcolspec/> and <relcell/> elements (in the <reltable/> section of the ditamap) have a linking attribute. This attribute allows you to configure how links are automatically generated in the output publication.

The linking attribute values consist of the following:

- targetonly - A topic can only be linked to and cannot link to other topics.
- sourceonly - A topic cannot be linked to but can link to other topics.
- normal - A topic can be linked to and can link to other topics. Use this to override the linking value of a parent topic.
- none - A topic cannot be linked to or link to other topics.

### Example syntax

### Use Cases

- You may not want the parent topic links to appear in each child topic. By setting the parent topic's linking attribute to sourceonly, the output result will show links from the parent to child topics, but not from child topics to the parent.
- if you did not want a particular branch of the ditamap hierarchy to have any generated links, you could set the parent topicref's linking attribute to none.

## Attachments:

Linking-Attribute-Ditamap.png (image/png)