Create TOC links to child elements of topic

daryl
Posts: 12
Joined: Thu Feb 11, 2021 9:22 pm

Create TOC links to child elements of topic

Post by daryl » Sat May 22, 2021 3:16 am

Hi,

Is it possible for the Webhelp Responsive Output to generate a second level TOC page for all the child dita files of a topic head?
To make it clear, I am trying to create a page that automatically generate links to all childs (child 1 and child 2) of topic 3 in the output.
Screen Shot 2021-05-21 at 5.14.53 PM.png
Screen Shot 2021-05-21 at 5.14.53 PM.png (15.72 KiB) Viewed 117 times

Thanks!

alin
Site Admin
Posts: 201
Joined: Thu Dec 24, 2009 11:21 am

Re: Create TOC links to child elements of topic

Post by alin » Mon May 24, 2021 11:19 pm

Hello,

It is not possible to generate an HTML page for a <topichead> entry. According to DITA Specification:
The <topichead> element provides a title-only entry in a navigation map, which should appear as a heading when the map is rendered as a table of contents. In print contexts it should also appear as a heading in the rendered content.
However, the Oxygen WebHelp Responsive output features a special component called Child Links that you could use to generate a second level TOC page.
For each topic, this component renders the links of the topic's direct children (according to the current DITA Map hierarchy). This component can be enabled by setting the webhelp.show.child.links parameter to yes.

You could obtain a second level TOC page in your output by following these steps:
  1. Instead of a <topichead>, use a <topicref> that references a topic with no content
  2. Create a custom Publishing Template
  3. Enable the Child Links component by setting the webhelp.show.child.links parameter to yes
  4. Add a custom CSS that styles the Child Links as tiles in order to obtain a similar layout with the one in the output's main page
You can use the following Publishing Template sample as an example for the workaround described above: https://github.com/oxygenxml/oxygen-pub ... with-tiles

You can use the following DITA map samples as input: Here is how the Child Links will be rendered when using the above Publishing Template:
Image

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply