Page 1 of 1

Easiest way to specify custom <div class="wh_publication_title"> in WebHelp Responsive?

Posted: Wed Sep 23, 2020 6:36 pm
by Graham Hannington
I'm unsure of the easiest/best way to replace the default contents of <div class=" wh_publication_title"> with custom contents.

An XSLT override for the <xsl:template match="whc:webhelp_publication_title"> in commonComponentsExpander.xsl strikes me as one way, but perhaps there's an easier way?

I want to include the product version in the wh_publication_title div. e.g.

Code: Select all

<whc:macro value="${path(/bookmap/bookmeta/prodinfo/vrmlist/vrm[1]/@version)}"/>
between the product name and the booktitle.

For my use case, the product version is significant: I want it in the banner/header.

Re: Easiest way to specify custom <div class="wh_publication_title"> in WebHelp Responsive?

Posted: Thu Sep 24, 2020 4:54 pm
by alin
Hello,

You can use one of these two placeholders to insert a custom fragment containing the product name and version near the <whc:webhelp_publication_title/>
  • webhelp.fragment.before.logo_and_title
  • webhelp.fragment.after.logo_and_title
You can use the map-xpath macro to extract the data from the bookmap (execute XPath expression):

Code: Select all

<div xmlns:whc="http://www.oxygenxml.com/webhelp/components" class="prodinfo">
    <div class="prodname"><whc:macro value="${map-xpath(/bookmap/bookmeta/prodinfo/prodname)}"/></div>
    <div class="version"><whc:macro value="${map-xpath(/bookmap/bookmeta/prodinfo/vrmlist/vrm[1]/@version)}"/></div>
</div>
In addition to this, you can use CSS styling to lay out the newly inserted content.

Regards,
Alin