Basic topic elements
The generic topic structure is used for untyped topics. While much of the DITA architecture is built on generic topics, it is generally better
to use
more specific information types (such as concept, task, or reference) when they are
available.
For an answer to the question "What are topics?" and more details on when to use different information types, see DITA topics.
In this section:
- <topic>The <topic> element is the top-level DITA element for a single-subject topic or article. Other top-level DITA elements that are more content-specific are <concept>, <task>, <reference>, and <glossentry>, all of which are specializations of the <topic> element.
- <title>The <title> element contains a heading or label for the main parts of a topic: the topic as a whole, sections, examples, and labelled content such as figures and tables. The element also can be used to provide a title for a map or a relationship table; when used in a relationship table, the title typically is used as a authoring convenience and is not rendered for display to an end user.
- <titlealts>The <titlealts> element allows the insertion of alternate titles, such as titles that should be used in creating a table of contents for navigation or a title specific to search results. When the <titlealts> element is absent, the <title> element is used for all title purposes.
- <searchtitle>The <searchtitle> element is used to specify a title that is displayed by search tools that locate the topic. This is most useful when the topic has a title that makes sense in the context of a single information set, but might be too general in a list of search results; for example, a topic title of "Markup example" might make sense as part of a guide to DITA, but when found among thousands of unrelated topics, a search title of "DITA markup example" is more useful.
- <navtitle>The navigation title (<navtitle>) element is one of a set of alternate titles that can be included inside the <titlealts> element. This navigation title might differ from the first level heading that shows in the main browser window. Use <navtitle> when the actual title of the topic isn't appropriate for use in a table of contents, navigation pane, or online content (for example, because the actual title is too long). Beginning with DITA 1.2, the <navtitle> element is also available in the <topicmeta> element in a <topicref> in a map, and its use is preferred over the <topicref> element's @navtitle attribute.
- <shortdesc>The <shortdesc> element provides a short description of the topic. The short description, which represents the purpose or theme of the topic, is also intended to be used as a link preview and for search results. The element can occur both in topics and maps.
- <abstract>The <abstract> element occurs between the topic title and the topic body. It is presented as the initial content of a topic. The <abstract> can contain paragraph-level content as well as one or more <shortdesc> elements which can be used for providing link previews or summaries.
- <body>The <body> element is the container for the main content of a <topic>.
- <bodydiv>The <bodydiv> element is used to contain informal blocks of information within the body of a topic. The <bodydiv> element is specifically designed to be a grouping element, without any explicit semantics, other than to organize subsets of content into logical groups that are not intended or should not be contained as a topic. As such, it does not contain an explicit title to avoid enabling the creation of deeply nested content that would otherwise be written as separate topics. For content that requires a title, use a <section> element or a nested topic.
- <related-links>The related information links of a topic (<related-links> element) are stored in a special section following the body of the topic. After a topic is processed into its final output form, the related links are usually displayed at the end of the topic, although some Web-based help systems might display them in a separate navigation frame.
- <dita>The <dita> element provides a top-level container for multiple topics when you create documents using the ditabase document type. The <dita> element lets you create any sequence of topics, and the ditabase document type lets you nest these topic types inside each other. The <dita> element has no particular output implications; it simply allows you to create multiple topics of different types at the same level in a single document.
Parent topic: Topic elements