Multiple Previous/Next links in wh_navigation_ links

rajrev_14364
Posts: 1
Joined: Tue Jul 13, 2021 1:40 pm

Multiple Previous/Next links in wh_navigation_ links

Post by rajrev_14364 » Tue Jul 13, 2021 1:51 pm

Hi,

For some reason, the WebHelp output renders multiple Previous/Next links for some topics while it renders perfectly fine other topics.

Here is a sample of how multiple Previous/Next links are generated:

________________________________________________________________________________________________________________________
<div class=" wh_navigation_links "><span id="topic_navigation_links" class="navheader">

<span class="navprev"><a class="- topic/link link - topic/link link" href="../opto_comp_ug/about_this_guide.html" title="About This Guide" aria-label="Previous topic: About This Guide" rel="prev"></a></span>
<span class="navnext"><a class="- topic/link link - topic/link link" href="../common_resources/conventions.html" title="Conventions" aria-label="Next topic: Conventions" rel="next"></a></span>

<span class="navprev"><a class="- topic/link link - topic/link link" href="../opto_comp_pdk/about_this_guide/about_this_guide.html" title="About This Guide" aria-label="Previous topic: About This Guide" rel="prev"></a></span>
<span class="navnext"><a class="- topic/link link - topic/link link" href="../common_resources/conventions.html" title="Conventions" aria-label="Next topic: Conventions" rel="next"></a></span> </span></div>
_________________________________________________________________________________________________________________________

What could be wrong? How can I fix this behavior?

Thanks in advance for your support!

Best wishes,
Raj. Revannuru

marius
Posts: 8
Joined: Thu Mar 05, 2009 11:44 am

Re: Multiple Previous/Next links in wh_navigation_ links

Post by marius » Wed Jul 14, 2021 12:38 pm

Hello,

Can you tell us what version of Oxygen are you using?
If this happens on the latest version, please send us a minimal valid DITA sample (map + few topics) to reproduce this.

Regards,

Marius Ciolacu
Oxygen XML Editor

kenrao
Posts: 10
Joined: Fri Jun 18, 2021 8:27 pm

Re: Multiple Previous/Next links in wh_navigation_ links

Post by kenrao » Mon Jul 19, 2021 3:47 pm

Hi,

I too am facing the exact same issue.

I seem to get multiple navigation links only when topics have nested topic sections and the transformation parameter force-unique is set as 'false'. If I set the parameter as 'true', the links appear fine for these pages. Not sure why this happens, but i do need force-unique to be set as 'false' and not get multiple navigation links. Also, the nested topics are not separate .dita files and are nested as <topic> elements within the main topic.dita file and i need it to be like this.

Example: topic.dita

Code: Select all

<topic>1.0
...<topic>1.1</topic>
...<topic>1.2</topic>
...<topic>1.3</topic>
</topic>
Could you please help.

Thanks,
Ken

marius
Posts: 8
Joined: Thu Mar 05, 2009 11:44 am

Re: Multiple Previous/Next links in wh_navigation_ links

Post by marius » Tue Jul 20, 2021 2:33 pm

Hi Ken,

Based on your findings I reproduced the multiple Previous/Next links issue on a ditamap that has several references to the same topic and the "force-unique" parameter is set to false
If this is your case, you should set the "copy-to" attribute on duplicated references to that topic, something like:

Code: Select all

<map>
    <title/>
    <topicref href="parent.dita" collection-type="sequence">
        <topicref href="Duplicated_topic.dita" copy-to="duplicated_topic_copy.dita"/>
        <topicref href="Topic1.dita"/>
        <topicref href="Duplicated_topic.dita"/>
        <topicref href="Topic2.dita"/>
    </topicref>
</map>
Regards,

Marius Ciolacu
Oxygen XML Editor
Marius Ciolacu
Syncro Soft / Oxygen XML

kenrao
Posts: 10
Joined: Fri Jun 18, 2021 8:27 pm

Re: Multiple Previous/Next links in wh_navigation_ links

Post by kenrao » Wed Jul 21, 2021 9:16 am

Hi Marius,

Thanks for the info. My topics are structured in the following way and I have hundreds of them. We migrated from another tool to Oxygen XML and I don't want to change this structure. Adding the copy-to attribute for each manually will be quite a task to do, unless there's some easier way of adding them.

Code: Select all

<map>
    <title/>
    <topicref href="parent.dita" collection-type="sequence">
        <topicref href="parent.dita#topic1"/>
        <topicref href="parent.dita#topic2"/>
        <topicref href="parent.dita#topic3"/>       
    </topicref>
</map>
We are using the latest build of Oxygen XML Author.

Thanks,
Ken

marius
Posts: 8
Joined: Thu Mar 05, 2009 11:44 am

Re: Multiple Previous/Next links in wh_navigation_ links

Post by marius » Wed Jul 21, 2021 1:50 pm

Hi Ken,

Ideally you should extract the nested topics as separate topics. You can do this easily from DITA Maps Manager view by using the contextual action Refactoring / Convert nested topics to new topics....
However, if this is not on option for you, than you can set the chunk="by-topic" attribute on each topicref to the parent.dita topic. This can be easily done also by using a refactoring action: Refactoring / Add/Change attribute...

Regards,

Marius Ciolacu
Oxygen XML Editor
Marius Ciolacu
Syncro Soft / Oxygen XML

kenrao
Posts: 10
Joined: Fri Jun 18, 2021 8:27 pm

Re: Multiple Previous/Next links in wh_navigation_ links

Post by kenrao » Thu Jul 22, 2021 11:13 am

Hi Marius,

Thanks for all the information. I think my best option is to go back to using force-unique="true". However, when i do this and i have nested topics, clicking the Next button also goes to these nested (#) topics.

Is there any way i can customize the Next/Previous links to skip links that have an anchor (#). If yes, could you please point me to the file where I can change this behavior?

For example, when i click the Next button from Topic1, i need it to go from Topic1 to Topic2, but right now it goes to Topic1#sub-topic1.

Code: Select all

<map>
    <title/>
    <topicref href="Topic1.dita" collection-type="sequence">
        <topicref href="Topic1.dita#sub-topic1"/>
        <topicref href="Topic1.dita#sub-topic2"/>            
    </topicref>
    <topicref href="Topic2.dita"/>   
</map>
Thanks,
Ken

radu_pisoi
Posts: 389
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Multiple Previous/Next links in wh_navigation_ links

Post by radu_pisoi » Mon Jul 26, 2021 9:50 am

Hi,

The navigation links(Next/Previous) are generated by the DITA-OT engine in the Map based linking (maplink) pre-processing stage.

This step collects links based on a map and moves those links into the referenced topics. The links are created based on hierarchy in the DITA map, the @collection-type attribute, and relationship tables. This step is implemented in XSLT and Java.

You can use the dita.xsl.maplink XSLT-import extension point to override the default implementation.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

kenrao
Posts: 10
Joined: Fri Jun 18, 2021 8:27 pm

Re: Multiple Previous/Next links in wh_navigation_ links

Post by kenrao » Tue Jul 27, 2021 7:23 am

Thanks, Radu.

I got the file to customize the Next/Prev links: maplinkNextPrevFullIteration.xsl. And adding [not(contains(@href,'#'))] to the 'next' and 'previous' sections works perfectly as I require them to.

So, to add this in my webhelp template, I would need to create a plugin. Something like this:

Code: Select all

<plugin id="com.oxygenxml.webhelp.responsive.custom.navlinks">
  <feature extension="dita.xsl.maplink" file="custom_maplinkNextPrevFullIteration.xsl"/>    
</plugin>
Is this correct and is there any other way of including a custom maplinkNextPrevFullIteration.xsl file in my webhelp template?

Thanks,
Ken

radu_pisoi
Posts: 389
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Multiple Previous/Next links in wh_navigation_ links

Post by radu_pisoi » Tue Jul 27, 2021 10:44 am

Hi,

You cannot use DITA-OT XSLT-import extension points in the WebHelp publishing template. The supported XSLT extension points in a publishing template are specified in the WebHelp documentation.

So, if you want to use dita.xsl.maplink XSLT extension point you have to create a DITA-OT customization plugin.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Post Reply