Chunked topic title not appearing as Page TOC on right pane

Post here questions and problems related to editing and publishing DITA content.
ejsumi
Posts: 11
Joined: Wed Dec 18, 2019 9:20 am

Chunked topic title not appearing as Page TOC on right pane

Post by ejsumi »

Hi Team,

For the webhelp output, we use the chunk 'to content' attribute for some topics, to have a combined output page.
When there is only one child topic, it does not show the "On this page" pane. But if there are 2 or more topics chunked, "On this page" pane appears.
I am using Oxygen XML 23.1

I want the web help output to show the child topic in "On this page" pane, even if it only one topic.
How can it be achieved?

Thanks,
Sumi
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: Chunked topic title not appearing as Page TOC on right pane

Post by Costin »

Hi,

Indeed, that is intended behavior. As also described in the topic toc component's description in the WebHelp Responsive User-Guide:
This component is generated for any topic that contains at least two <section> elements and each <section> must have an @id attribute.
Most probably, that structure could be modified through an XSLT customization of your own.
You can find here more information on how to customize using XSLT.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Chunked topic title not appearing as Page TOC on right pane

Post by chrispitude »

Hi Sumi,

Adding to what Costin said, if you inspect the WebHelp topic structure, you will see an HTML structure like this, with an @id of wh_topic_toc:

Code: Select all

<nav role="navigation" id="wh_topic_toc" aria-label="On this page" class="col-lg-2 d-none d-lg-block navbar d-print-none"> 
  <div id="wh_topic_toc_content">
     <div class=" wh_topic_toc ">
       <div class="wh_topic_label">On this page</div>
       <ul>...</ul>
     </div>
  </div>
</nav>
Then if you search the WebHelp plugin directory for this value, you will see a template like this in topicComponentsExpander.xsl:

Code: Select all

<!-- Expand 'webhelp_topic_toc' place holder. -->
<xsl:template match="whc:webhelp_topic_toc" mode="copy_template">
  ...
  <xsl:if test="count($generate_topic_toc/ul/descendant::li) > 1">
    ...
  </xsl:if>
  ...
</xsl:template>
I think if you made a plugin that overrode this template with a copy except for the "count() > 1" test changed to "count() >= 1", you should get what you want. You would need to identify the right extension point, etc.
ejsumi
Posts: 11
Joined: Wed Dec 18, 2019 9:20 am

Re: Chunked topic title not appearing as Page TOC on right pane

Post by ejsumi »

Thanks for the inputs, will try it out.
Post Reply