Could someone please help my with this? I simply want to render an image from the media picker on my home page. The code works fine until I add the media picker and img lines. But when I add them in I am unable to save due to an error occurring.
Can anyone see something wrong with my code?
Any help would be really appreciated because I've searched and tried for a while with this and gotten nowhere!?
xslt for media picker to render image
Hi,
Could someone please help my with this? I simply want to render an image from the media picker on my home page. The code works fine until I add the media picker and img lines. But when I add them in I am unable to save due to an error occurring.
Can anyone see something wrong with my code?
Any help would be really appreciated because I've searched and tried for a while with this and gotten nowhere!?
Thank You
Andy
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:for-each select="$currentPage/ancestor-or-self::*/product/data/item">
<div class="span3">
<div class="circleRed">
<xsl:if test="position() mod 2 = 0">
<xsl:attribute name="class">circleAmber</xsl:attribute>
</xsl:if>
<xsl:if test="position() mod 3 = 0">
<xsl:attribute name="class">circleGreen</xsl:attribute>
</xsl:if>
<div class="circleInner"> </div>
<xsl:variable name="media" select="umbraco.library:GetMedia(productPhoto, false())" />
<img alt="{$media/@nodeName}" src="{$media/umbracoFile}" width="{$media/umbracoWidth}" height="{$media/umbracoHeight}" />
</div>
<h3><xsl:value-of select="productTitle"/></h3>
<p><xsl:value-of select="productDesc"/></p>
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
is working on a reply...