Autonumbering Task Topic Titles for Tutorials in Webhelp

dgallo
Posts: 90
Joined: Tue Mar 31, 2015 10:43 pm

Autonumbering Task Topic Titles for Tutorials in Webhelp

Post by dgallo » Tue Aug 29, 2017 11:05 pm

We are using a series of task topics to create one large tutorial. In the DITA webhelp, is it possible to automatically assign a number in the title of each task topic. We would only want this customization to apply to the task topics that make a tutorial, not for normal task topics.

For example:

T-1000: Introduction Tutorial
Topic (1: Title)
Topic (1.1 Title)
Topic (2: Title)
Topic (2.1 Title)
Topic (3: Title)
Topic (4: Title)
Topic (4.1: Title)
Topic (4.2: Title)

bogdan_cercelaru
Posts: 214
Joined: Tue Jul 01, 2014 11:48 am

Re: Autonumbering Task Topic Titles for Tutorials in Webhelp

Post by bogdan_cercelaru » Wed Aug 30, 2017 5:02 pm

Hello,

Assuming that you are using the chunk="to-content" attribute to obtain one large tutorial from a series of topics, you could use the outputclass attribute and the CSS Counters to obtain what you required.
The outputclass attribute should be set on the root element of the topic that will be included in the bigger tutorial. Below is an example of a CSS that you can use:

Code: Select all


body {
counter-reset: section;
}
.custom-section {
counter-reset: subsection;
}
.custom-section>.title::before {
counter-increment: section;
content: counter(section) ": Title";
}
.custom-subsection>.title::before{
counter-increment: subsection;
content: counter(section) "." counter(subsection) ": Title";
}
Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Post Reply