Copied to clipboard

Flag this post as spam?

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


  • Alex 9 posts 30 karma points
    Jun 16, 2011 @ 15:31
    Alex
    0

    Custom property from image media type

    I added a new property (title) to the Image media type but can't seem to get it work in the xslt.

    <xsl:param name="imageFolder" select="/macro/imageFolder/Folder/@id"/>
        <xsl:if test="$imageFolder != 0">
          <p style="text-align: center;">
            <xsl:for-each select="umbraco.library:GetMedia($imageFolder, 'true')/descendant-or-self::*[@nodeTypeAlias='Image']/umbracoFile">
              <img style="width: 50px; margin-left: 5px; margin-right: 5px;">
                <xsl:attribute name="src"><xsl:value-of select="." /></xsl:attribute>
                <xsl:attribute name="alt"><xsl:value-of select="../@nodeName" /></xsl:attribute>
                <xsl:attribute name="title"><xsl:value-of select="./title" /></xsl:attribute>
              </img>
            </xsl:for-each>
          </p>
        </xsl:if>

     

    Always comes out blank, Any ideas, know i must have missed something simple somewhere.

  • Alex 9 posts 30 karma points
    Jun 16, 2011 @ 16:50
    Alex
    0

    Solved, I was enuming the umbracoFile node.

    Should be

     <xsl:for-each select="umbraco.library:GetMedia($imageFolder, 'true')/descendant-or-self::*[@nodeTypeAlias='Image']">

Please Sign in or register to post replies

Write your reply to:

Draft