I'm trying to display images I've uploaded to child nodes on the parent node in a <ul> but the images aren't being displayed only the node title. I created an alias "projectImage" which has the upload datatype.
<!-- a little hack to work around the xslt syntax checker when opening/closing UL lists in two separate IF statements --> <!-- if it weren't for IE we could use a single UL and simply float the LI's and they'd auto-wrap --> <!-- but for IE we either need separate UL rows or else we need to hard-code the LI's height in CSS --> <!-- this approach with separate UL rows works in all browsers and row heights --> <xsl:variable name="ulOpen"><xsl:text><ul id="slider1"></xsl:text></xsl:variable> <xsl:variable name="ulClose"><xsl:text></ul></xsl:text></xsl:variable>
<xsl:for-each select="$currentPage/* [@isDoc][string(umbracoNaviHide) != '1']"> <!-- open a row of images --> <xsl:if test="position() = 1 or position() mod $imagesPerRow = 0"> <xsl:value-of select="$ulOpen" disable-output-escaping="yes" /> </xsl:if>
<!-- display each image in the row, with the count of photos in each gallery --> <li> <img src="/umbraco/ImageGen.ashx?image={./data[@alias = 'projectImage']}&width=738&height=300&constrain=true" alt="{@nodeName}" title="{@nodeName}"/> </li>
<!-- close the row of images --> <xsl:if test="position() = ($imagesPerRow - 1) or position() mod ($imagesPerRow - 1) = 0 or position() = last()"> <xsl:value-of select="$ulClose" disable-output-escaping="yes"/> </xsl:if> </xsl:for-each>
<!-- a little hack to work around the xslt syntax checker when opening/closing UL lists in two separate IF statements --> <!-- if it weren't for IE we could use a single UL and simply float the LI's and they'd auto-wrap --> <!-- but for IE we either need separate UL rows or else we need to hard-code the LI's height in CSS --> <!-- this approach with separate UL rows works in all browsers and row heights --> <xsl:variable name="ulOpen"><xsl:text><ul id="slider1"></xsl:text></xsl:variable> <xsl:variable name="ulClose"><xsl:text></ul></xsl:text></xsl:variable>
<xsl:for-each select="$currentPage/* [@isDoc][string(umbracoNaviHide) != '1']"> <!-- open a row of images --> <xsl:if test="position() = 1 or position() mod $imagesPerRow = 0"> <xsl:value-of select="$ulOpen" disable-output-escaping="yes" /> </xsl:if>
<!-- display each image in the row, with the count of photos in each gallery --> <li> <xsl:if test="projectImage != ''"> <img alt=""> <xsl:attribute name="src"> <xsl:value-of select="projectImage" /> </xsl:attribute> </img> </xsl:if> </li>
<!-- close the row of images --> <xsl:if test="position() = ($imagesPerRow - 1) or position() mod ($imagesPerRow - 1) = 0 or position() = last()"> <xsl:value-of select="$ulClose" disable-output-escaping="yes"/> </xsl:if> </xsl:for-each>
Image gallery list from child node upload field
I'm trying to display images I've uploaded to child nodes on the parent node in a <ul> but the images aren't being displayed only the node title. I created an alias "projectImage" which has the upload datatype.
What am I doing wrong?
Don't worry I've solved this, here's my code just incase:
is working on a reply...