Page 1 of 1

Prev - Next arrows for WebHelp Responsive

Posted: Thu May 26, 2016 3:19 am
by pault
I would like to have Prev - Next arrows for all topics in the HTML generated by WebHelp Responsive. I see that they can be implemented using collection-type="sequence" but this isn't sufficient. What needs to be done to implement this?

Re: Prev - Next arrows for WebHelp Responsive

Posted: Thu May 26, 2016 2:45 pm
by radu_pisoi
Hi,

Did you try to set collection-type="sequence" on the root map?
Are the links between topics generated as you expected in this case?

Re: Prev - Next arrows for WebHelp Responsive

Posted: Fri May 27, 2016 12:08 am
by pault
Hi Radu,

After trying what you suggested, I discovered that we would need to set the collection type on numerous topics. This would be an awful lot of manual work. Here's what I mean:

Top-level ditamap:

Code: Select all

<map collection-type="sequence">
<title>Upgrade Guide</title>
<topicref href="upgrade/upgradeAbout.dita" keys="upgradeAbout"/>
<topicref href="upgrade/dse/upgrdAnyVersion.dita" keys="upgrdAnyVersion"/>
<mapref href="upgrade/dse/upgradeDSE.ditamap" format="ditamap"/>
...
In a sub-level ditamap:

Code: Select all

<map collection-type="sequence">
<title>Upgrading DataStax Enterprise</title>
<topicref href="upgrdDSEUpgrading_g.dita" keys="upgrdDSEUpgrading_g" collection-type="sequence">
<topicref href="upgDSEplanning.dita" keys="upgDSEplanning"/>
...
</topicref>
<topicref href="upgDSE32.dita" keys="upgDSE32" collection-type="sequence">
<topicref href="upgradeFrom3_0.dita" keys="upgradeFrom3_0"/>
...
<topicref href="upgradeRollbackDSETarball.dita" keys="upgradeRollbackDSETarball"/>
</topicref>
...
Is there some way to do this without all the manual labor?

Thanks,

Paul

Re: Prev - Next arrows for WebHelp Responsive

Posted: Mon May 30, 2016 4:57 pm
by radu_pisoi
Hi,
pault wrote:Is there some way to do this without all the manual labor?
Yes, you can modify the files from a DITA map hierarchy by using the XML Refactoring tool.

To set the collection-type attribute on the empty topicref elements you can use the Add/Change attribute operation.

When you specify the parent element, you can use the next XPath expression: topicref[count(*) > 0]. For attribute name and value use collection-type and sequence. As operation mode you can use Add the attribute in the parent elements when it is missing.

When you have to choose a scope please make sure you select the Current DITA map hierarchy.

Re: Prev - Next arrows for WebHelp Responsive

Posted: Wed Jul 06, 2016 9:53 pm
by pault
Hi Radu,

Our dev process was interrupted by a release. Although your suggestion works, it still involves a lot of manual work because many documents. I made a stab at modifying a template in maplinkNextPrevFullInteration.xsl, which works. By removing *[@collection-type='sequence']/ from line10

Code: Select all

<xsl:template match="*[@collection-type='sequence']/*[contains(@class, ' map/topicref ')]
I can simply set the collection type to sequence on the root map and Prev Next arrows appear on every topic.

However, the problem is that if I create a plugin to do this, it's overridden by the template in maplinkNextPrevFullInteration.xsl. How do you override templates in the com.oxygenxml.webhelp plugin? I tried setting the priority but that didn't work.

I am using the latest build from 27 June.

Re: Prev - Next arrows for WebHelp Responsive

Posted: Thu Jul 07, 2016 12:40 pm
by radu_pisoi
Hi,

Unfortunately, the Webhelp plugin does not support any XSLT extension point that allows you to import customization XSLT. We already have registered this issue and I will add your vote for it.

A workaround is to use the 'dita.xsl.maplink' extension point to point to your customization XSL.
So, you can open:

Code: Select all

{oXygenInstallDir}/frameworks/dita/DITA-OT2.x/plugins/com.oxygenxml.webhelp/plugin_commons.xml
and add your customization XSLT after the extension that points to 'maplinkNextPrevFullIteration.xsl'. Something like:

Code: Select all

<feature extension="dita.xsl.maplink" value="xsl/dita/maplinkNextPrevFullIteration.xsl" type="file"/>
<feature extension="dita.xsl.maplink" value="xsl/dita/extension.xsl" type="file"/>

Re: Prev - Next arrows for WebHelp Responsive

Posted: Tue Oct 03, 2017 8:33 am
by radu_pisoi
Hi,

We released Oxygen WebHelp 19.1 a couple of days ago and I am pleased to inform you that the possibility to set the default value for the DITA Map collection-type attribute to sequence. This option is helpful if you want to have 'Next' and 'Previous' navigational buttons generated for all HTML pages.

You can do this by using the webhelp.default.collection.type.sequence parameter.

Please note that this option is available only for WebHelp Responsive and for DITA-OT 2.x.