Use Case 2: Add generation time in the output footer

Another possible customization for the main page is to add the generation time in its footer. We will use a transformation parameter to control if this customization is active or not.

Figure: Generation time added in the WebHelp footer

To add this functionality, follow these steps:

  1. In the customization stylesheet that you just created (for example, custom_mainpage.xsl), modify the template by adding the following XSLT code at the end.
    <xsl:if test="oxyf:getParameter('webhelp.footer.add.generation.time') = 'yes'">
      <div class="generation_time">
        Generation date: <xsl:value-of 
        select="format-dateTime(
                       current-dateTime(), 
                       '[h1]:[m01] [P] on [M01]/[D01]/[Y0001].')"/>
      </div>
    </xsl:if>
    Note: You can read the value of a WebHelp transformation parameter from your XSLT extension stylesheets by using the getParameter(param.name) function from the http://www.oxygenxml.com/functions namespace.
  2. Open the template descriptor file associated with your publishing template and set the webhelp.footer.add.generation.time parameter to the default value.
    <publishing-template>
        ...    
        <webhelp>
          ...
          <parameters>
            <parameter 
              name="webhelp.footer.add.generation.time" 
              value="yes"/>
  3. Open the DITA Map WebHelp Responsive transformation scenario.
  4. In the Parameters tab, you can change the value of the webhelp.footer.add.generation.time parameter.
  5. Click OK to save the changes to the transformation scenario.
  6. Run the transformation scenario.