Image for WHR header from map/topichead/topicmeta/data/image
Posted: Thu Jun 12, 2025 6:03 pm
EDIT: Is there a simpler way to do this? Maybe take the href of the image with outputclass="header-img" and use that to set the value of webhelp.logo.image?
Thanks in advance for the help... My XSLT is a little rusty, and I'm sure there's something obvious I'm missing, but here's my issue...
I'm customizing a Webhelp Responsive plugin.
I need an image in my html page headers that changes for each map published, so I've placed an image in the map within a data element within the map's topicmeta element...
Here's my XSLT (testing in commonComponentsExpander.xsl):
Again, thanks in advance for any help someone can provide.
Thanks in advance for the help... My XSLT is a little rusty, and I'm sure there's something obvious I'm missing, but here's my issue...
I'm customizing a Webhelp Responsive plugin.
I need an image in my html page headers that changes for each map published, so I've placed an image in the map within a data element within the map's topicmeta element...
Code: Select all
<map>
<title>Map Title</title>
<topicmeta>
<data><image outputclass="header-img" href="image.jpg" id="image_123456"/></data>
</topicmeta>
Code: Select all
<xsl:template match="whc:webhelp_logo" mode="copy_template">
<xsl:variable name="headerImage" select="/map/topicmeta/data/image[@outputclass='header-img']/@href"/>
<!-- If the image reference exists, insert an <img> tag -->
<xsl:if test="$headerImage">
<img src="{$headerImage}" alt="Header logo"/>
</xsl:if>
<xsl:if test="not($headerImage)"/>
</xsl:template>