Image for WHR header from map/topichead/topicmeta/data/image
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 14
- Joined: Thu Apr 21, 2016 8:49 pm
Image for WHR header from map/topichead/topicmeta/data/image
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>
-
- Posts: 40
- Joined: Thu Jul 29, 2021 12:02 pm
Re: Image for WHR header from map/topichead/topicmeta/data/image
Post by InspectorSpacetime »
Hi,
You can also set the logo image dynamically by using the ${xpath_eval} editor variable in the webhelp.logo.image transformation parameter:
Not sure it works in your use case, but thought I'd mention it..
You can also set the logo image dynamically by using the ${xpath_eval} editor variable in the webhelp.logo.image transformation parameter:
Code: Select all
${xpath_eval(/map/topicmeta/data/image[@outputclass='header-img']/@href)}
-
- Posts: 681
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Image for WHR header from map/topichead/topicmeta/data/image
Post by julien_lacour »
Hello,
I confirm InspectorSpacetime's solution works: you can directly use ${xpath_eval} editor variable for this use-case.
However, a limitation is that editor variables only work in Oxygen's transformation dialog.
Regards,
Julien
I confirm InspectorSpacetime's solution works: you can directly use ${xpath_eval} editor variable for this use-case.
However, a limitation is that editor variables only work in Oxygen's transformation dialog.
Regards,
Julien
-
- Posts: 681
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Image for WHR header from map/topichead/topicmeta/data/image
Post by julien_lacour »
Hello,
Another solution is to use an HTML fragment, this solutions works in Oxygen and using Oxygen Publishing Engine and is based on a publishing template: Dynamic Logo Template
Regards,
Julien
Another solution is to use an HTML fragment, this solutions works in Oxygen and using Oxygen Publishing Engine and is based on a publishing template: Dynamic Logo Template
Regards,
Julien
-
- Posts: 14
- Joined: Thu Apr 21, 2016 8:49 pm
Re: Image for WHR header from map/topichead/topicmeta/data/image
Thanks for the responses. I ended up realizing that putting the image in topicmeta/data was complicating things and made the image the href of a keydef on the map. After that everything fell into place.
-G
-G
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service