Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I want to show an image that has been selected from a Media Picker. I have created an XSLT and a Macro.
I want to reuse the macro on several pages so I need to pass a parameter to my Macro with the property-id of the Media Picker.
Something like this: (except from that $currentPage/$imageName is not working)
<xsl:param name="currentPage"/><xsl:param name="imageName" select="macro/ImageName" /> <xsl:template match="/"> <xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/$imageName, 0)" /> <xsl:if test="$media"> <img src="{$media/umbracoFile}" /></xsl:if></xsl:template>
Hi,
Try using this instead:
<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/* [local-name() = $imageName], 0)" />
-Tom
It works! Thank you! You saved me a lot of time and frustration :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Pass parameter to GetMedia
I want to show an image that has been selected from a Media Picker. I have created an XSLT and a Macro.
I want to reuse the macro on several pages so I need to pass a parameter to my Macro with the property-id of the Media Picker.
Something like this: (except from that $currentPage/$imageName is not working)
<xsl:param name="currentPage"/>
<xsl:param name="imageName" select="macro/ImageName" />
<xsl:template match="/">
<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/$imageName, 0)" />
<xsl:if test="$media">
<img src="{$media/umbracoFile}" />
</xsl:if>
</xsl:template>
Hi,
Try using this instead:
-Tom
Hi,
It works! Thank you! You saved me a lot of time and frustration :-)
is working on a reply...