Page 1 of 1

Add Prev Next links with titles

Posted: Tue Sep 20, 2016 11:31 pm
by pault
Hi,

I am using Webhelp Responsive and have implemented the Prev/Next arrows on every topic page in both the breadcrumb area and at the bottom of the page. However for the bottom of the page, I'd like to use the actual topic titles instead of arrows. This seems like it should be easy, but I can't figure out how to do it. What do I need to do on the wt_topic template page and anywhere else to make this happen?

Thanks in advance,

Paul

Re: Add Prev Next links with titles

Posted: Wed Sep 21, 2016 4:06 pm
by radu_pisoi
Hi,
pault wrote: However for the bottom of the page, I'd like to use the actual topic titles instead of arrows.
To apply different styling/processing depending where the navigation links are displayed you can specify a certain class when you duplicate the Webhelp component. You will find this class in the Webhelp output.

Code: Select all

<whc:webhelp_navigation_links class="bottom_navigation_links"/>
Now, to display the topic title you can use this specific class (bottom_navigation_links) and the a/@title attribute( it contains the topic title). Next, you need a custom JS to copy this information.

Please note that the tooltip text displayed when you hover the navigation links prefers the topic's short description. Thus, if a topic has a short description then it will be used for hover text, otherwise the title of the topic.

This tooltip text is computed from XSLT, so if you don't want to display the topic's short description you need to modify the XSLT stylesheets too. You need to modify the next stylesheet: DITA-OT2.x/plugins/com.oxygenxml.webhelp/xsl/dita/rel-links.xsl

Comment the next template call:

Code: Select all

<xsl:apply-templates select="." mode="add-desc-as-hoverhelp"/>

Re: Add Prev Next links with titles

Posted: Mon Sep 26, 2016 8:46 pm
by pault
Thanks Radu, we implemented this quite easily with your advice!