<bookrights>
<copyrfirst>
<year>2002</year>
</copyrfirst>
<copyrlast>
<year>2017</year>
</copyrlast>
<bookowner>
<organization>SyncRO Soft SRL</organization>
</bookowner>
</bookrights>
copy_template mode that processes the main page template to
expand its components. The main page template declares a component for the footer section that
looks like
this:<div class=" footer-container text-center ">
<whc:include_html href="${webhelp.fragment.footer}"/>
</div>Step Result: You should have the custom_footer_template folder linked in your project.
Step Result: You should have the custom_footer_template/xsl folder in your project.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:oxygen="http://www.oxygenxml.com/functions"
exclude-result-prefixes="xs"
version="3.0">
<xsl:template match="*:div[contains(@class, 'footer-container')]" mode="copy_template">
<!-- Apply the default processing -->
<xsl:next-match/>
<!-- Add a div containing the copyright information -->
<div class="copyright_info">
<xsl:choose>
<!-- Adds the start-end years if they are defined -->
<xsl:when test="exists($toc/*:topicmeta/*:bookrights/*:copyrfirst) and
exists($toc/*:topicmeta/*:bookrights/*:copyrlast)">
<span class="copyright_years">
©<xsl:value-of select="$toc/*:topicmeta/*:bookrights/*:copyrfirst"/>
-<xsl:value-of select="$toc/*:topicmeta/*:bookrights/*:copyrlast"/>
</span>
</xsl:when>
<!-- Adds only the first year if last is not defined. -->
<xsl:when test="exists($toc/*:topicmeta/*:bookrights/*:copyrfirst)">
<span class="copyright_years">
©<xsl:value-of select="$toc/*:topicmeta/*:bookrights/*:copyrfirst"/>
</span>
</xsl:when>
</xsl:choose>
<xsl:if test="exists($toc/*:topicmeta/*:bookrights/*:bookowner/*:organization)">
<span class="organization">
<xsl:text> </xsl:text><xsl:value-of
select="$toc/*:topicmeta/*:bookrights/*:bookowner/*:organization"/>
<xsl:text>. All rights reserved.</xsl:text>
</span>
</xsl:if>
</div>
</xsl:template>
</xsl:stylesheet><publishing-template>
...
<webhelp>
...
<xslt>
<extension
file="xslt/customMainPage.xsl"
id="com.oxygenxml.webhelp.xsl.createMainPage"/>
</div>
element).<xsl:if test="oxygen: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>oxygen:getParameter(param.name)
function can be called to get the value of any WebHelp transformation parameter.
Just make sure the
xmlns:oxygen="http://www.oxygenxml.com/functions" namespace is
declared in the stylesheet.webhelp.footer.add.generation.time parameter to the default
value.<publishing-template>
...
<webhelp>
...
<parameters>
<parameter
name="webhelp.footer.add.generation.time"
value="yes"/>webhelp.footer.add.generation.time parameter.