Customizing WebHelp Responsive header

Pascale
Posts: 35

Customizing WebHelp Responsive header

Wed Jan 09, 2019 7:51 pm

Hi,
we have a custom DITA map DTD, with additional metadata that we want to show in the header in a customized WebHelp Responsive plugin, as part of the title.
For example, we want to display the product name before and the document version after the title's text, and the entire string must be included in the link ('<a href=...>)' element.
Can you please explain how we can achieve this ?
Is there a parameter, an extension-point or an element of the publishing template that we can customize ?

Kind regards,
Pascale
Pascale
Posts: 35

Re: Customizing WebHelp Responsive header

Thu Jan 17, 2019 12:53 pm

Hi,
any idea on this ?
Would it help if I re-formulate my question as : how can I customize the <whc:webhelp_publication_title> component ?

Pascale
alin
Site Admin
Posts: 134

Re: Customizing WebHelp Responsive header

Fri Jan 18, 2019 4:14 pm

Hello,

You can retrieve metedata info from your input map using the macros template components: https://www.oxygenxml.com/doc/versions/ ... gment_file.

You can add content before and after the <whc:webhelp_publication_title> component by expanding it in the HTML Layout files as follows:

Code: Select all

<whc:webhelp_publication_title>
   <!-- Content before component content -->   
   
   <whc:component_content/>                       
   
   <!-- Content after component content -->
</whc:webhelp_publication_title>

This support is available for all whc:* template components.

Supposing you have the following metadata in your DITA map:

Code: Select all

<map>
  <title>Growing Flowers</title>
 
  <topicmeta>
    <prodinfo>
      <prodname>My product</prodname>
      <vrmlist>
        <vrm version="20.1"/>
      </vrmlist>
    </prodinfo>
  </topicmeta>
  .....
 </map>


You can use the map-xpath macro to retireve the product name and the product version from the DITA map and insert these data before and after the publication title as follows:

Code: Select all


<whc:webhelp_publication_title>
   <span class="wh_publication_title before-title">
      <a href="${path(oxygen-webhelp-output-dir)}/index.html">
         <span>[<whc:macro value="${map-xpath(/map/topicmeta/prodinfo[1]/prodname/text())}"/>]</span>
      </a>
   </span>
   
   <whc:component_content/>                       
   
   <span class="wh_publication_title after-title">
      <a href="${path(oxygen-webhelp-output-dir)}/index.html">
         <span>[v. <whc:macro value="${map-xpath(/map/topicmeta/prodinfo[1]/vrmlist/vrm[1]/@version)}"/>]</span>
      </a>
   </span>
</whc:webhelp_publication_title>



Note that you will obtain 3 <a> elements: one for the content before, one for the actual title and one for the content after the title.
You can customize the styles for the added content by providing additional CSS to the WebHelp Responsive transformation: https://www.oxygenxml.com/doc/versions/ ... h-css.html

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 1 guest