Copied to clipboard

Flag this post as spam?

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


  • James Mason 11 posts 31 karma points
    Jan 19, 2011 @ 13:58
    James Mason
    0

    Using Image Cropper Code with the Related Links Macro

    Hello, 

    I am trying to set it up so that a user can create a Related Links menu and choose an image to accompany each one (after they have prepared it with Image Cropper).

    I have watched the Using Image Cropper Datatype video and currently have this portion of code in the Related Links xslt file:

    <xsl:if test="count($featuredLinks)">
        <ul>
          <xsl:for-each select="$featuredLinks">
            <li>
              <img>
              <xsl:attribute name="src">
              <xsl:value-of select="umbraco.library:GetMedia($currentPage/ancestor-or-self::*[@isDoc and @level = 1]/image1, 'false')/imageCropper//crop[@name = 'Test']/@url"/>
              </xsl:attribute>
              </img>
              <xsl:element name="a">
                <xsl:if test="./@newwindow = '1'">
                  <xsl:attribute name="target">_blank</xsl:attribute>
                </xsl:if>
                <xsl:choose>
                  <xsl:when test="./@type = 'external'">
                    <xsl:attribute name="href">
                      <xsl:value-of select="./@link"/>
                    </xsl:attribute>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:attribute name="href">
                      <xsl:value-of select="umbraco.library:NiceUrl(./@link)"/>
                    </xsl:attribute>
                  </xsl:otherwise>
                </xsl:choose>
                <xsl:value-of select="./@title"/>
              </xsl:element>
            </li>
          </xsl:for-each>
        </ul>
        <!-- Live Editing support for related links. -->
        <xsl:value-of select="umbraco.library:Item($currentPage/@id,$propertyAlias,'')" />
        </xsl:if>

     

    So at the moment for each related link the same cropped image is displayed. I guess I need to use a count test, similar to the way the 'Related Links' is constructed but for the cropped images?

    James

Please Sign in or register to post replies

Write your reply to:

Draft