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

Post here questions and problems related to editing and publishing DITA content.
Graham Hannington
Posts: 48
Joined: Mon Jun 13, 2016 11:23 am

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

Post 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.
alin
Site Admin
Posts: 268
Joined: Thu Dec 24, 2009 11:21 am

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

Post 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
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply