Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Denham 8 posts 28 karma points
    Feb 08, 2012 @ 12:39
    Andrew Denham
    0

    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">&nbsp;</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>

Please Sign in or register to post replies

Write your reply to:

Draft