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:
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?
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
is working on a reply...