WebHelp Responsive Publication TOCs (I'm so confused)

Post here questions and problems related to editing and publishing DITA content.
doctissimus
Posts: 34
Joined: Tue Mar 03, 2020 11:15 pm

WebHelp Responsive Publication TOCs (I'm so confused)

Post by doctissimus »

Hi. I searched the forum unsuccessfully, so I'll try to simplify what I'm working with here...

For my product documentation, I have a top-level map that references two separate guides:

Code: Select all

<map>
  <mapref href="user_guide/user_guide.ditamap" format="ditamap"/>
  <mapref href="sysadmin_guide/sysadmin_guide.ditamap" format="ditamap"/>
</map>
The user guide contains three topics:
user_guide_1.dita
user_guide_1_subsection.dita
user_guide_2.dita

The sysadmin guide contains three topics:
sysadmin_guide_1.dita
sysadmin_guide_1_subsection.dita
sysadmin_guide_2.dita

The top-level ditamap file sort of works when I do this with the ditamaps that it references:

User guide ditamap

Code: Select all

<map>
  <topicref href="topics/user_guide_1.dita" chunk="to-content" >
    <topicref href="topics/user_guide_1_subsection.dita" toc="no"/>
  </topicref>
  <topicref href="topics/user_guide_2.dita" toc="no"/>
<map>
Sysadmin guide ditamap

Code: Select all

<map>
  <topicref href="topics/sysadmin_guide_1.dita" chunk="to-content" >
    <topicref href="topics/sysadmin_guide_1_subsection.dita" toc="no"/>
  </topicref>
  <topicref href="topics/sysadmin_guide_2.dita" toc="no"/>
</map>
Those who are more on the ball than I am will likely recognize this as a recipe for getting WebHelp output with two non-nested entries in the Publication TOC of the user_guide_1.html and sysadmin_guide_1.html pages. I'm trying to get from that basic output to one that has a Publication TOC more like the following:

Code: Select all

[title for user_guide_1.html]
├─ [title for user_guide_2.html]
[title for sysadmin_guide_1.html]
├─ [title for sysadmin_guide_2.html]
I've tried different combinations of chunk and toc attribute values. I've tried moving around the topicref for user_guide_2.dita and sysadmin_guide_2.dita. All I ever seem to get is either a Publication TOC with only one entry for each guide on the "1" pages (and no Publication TOC at all on the "2" pages), or a "2" tile for each guide on the main page (which I don't want).

I'm probably not explaining my situation very well, but any guidance is appreciated. Thanks.
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: WebHelp Responsive Publication TOCs (I'm so confused)

Post by chrispitude »

Hi doctissimus,

When we were assembling books into a higher-level WebHelp map, I was confused why the book titles weren't showing up in the WebHelp's top-level TOC. Then I learned that when you reference a submap, the title of the submap does not create a level of navigation hierarchy.

To accomplish this, I developed our "com.synopsys.mapref-topichead" DITA-OT plugin:

DITA-mapref-topichead

The README.md file there has a description of the problem and the solution, so I won't repeat it here. But if you use this plugin, you should be able to add this @outputclass value:

Code: Select all

<map>
  <mapref href="user_guide/user_guide.ditamap" outputclass="topichead"/>
  <mapref href="sysadmin_guide/sysadmin_guide.ditamap" outputclass="topichead"/>
</map>
and get the results you want. The nice thing about this plugin is that variables, conditional profiling, etc., in the title are all processed correctly.
doctissimus
Posts: 34
Joined: Tue Mar 03, 2020 11:15 pm

Re: WebHelp Responsive Publication TOCs (I'm so confused)

Post by doctissimus »

Thanks very much, chrispitude. I'll try the OT plugin that you were generous enough to share.

In the meantime and as a stop-gap (and for the possible benefit of those who read this thread in the future), I was able to suppress tiles that I didn't want to show up on the main page by way of a topicmeta -> data element, as follows:

Code: Select all

<topicmeta>
    <data name="wh-tile">
        <data name="hide" value="yes"/> <!-- Hides this item (e.g. a topicref) from the main page tiles -->
    </data>
</topicmeta>
Post Reply