#### 24.8.3 Specifying the ID for a DITA topic

To give a topic an ID, do one of the following:

- Place a DITATopicID PI marker in the topic; the content of the DITATopicID marker is the topic ID.
- Place a FileName PI marker in the topic; the marker content specifies both the topic ID and the base file name of the file that contains the topic (see §43.3.2 Using PI markers to name output files).

In the absence of either marker, the default topic ID is the base file name, adjusted as for CSS class names; see §24.8.4 Adjusting DITA topic IDs generated from file names.

If you do not insert markers for topic IDs, DITA2Go makes up an ID for each embedded topic after the first (which uses the base file name). These generated IDs are of the form topic2, topic3, and so forth. This is not recommended practice.

To specify a default ID other than the base file name (but only for the first topic in a file), include the following option in your project configuration file:

    [DITAOptions]
    ; TopicID = id for topic, default is base file name
    TopicID = someid

You can override the default ID with a DITATopicID PI marker, or with a FileName PI marker.

Previous Topic: 24.8.2.4 Specifying the DITA topic type with a marker

Next Topic: 24.8.4 Adjusting DITA topic IDs generated from file names

Parent Topic: 24.8 Configuring DITA topics

Sibling Topics:

24.8.1 Designating starting points for DITA topics

24.8.2 Specifying the DITA topic type

24.8.4 Adjusting DITA topic IDs generated from file names

24.8.5 Specifying alternate titles for a DITA topic

24.8.6 Omitting a DITA topic from the TOC