Hi,
I am totally stuck when trying to get a media image in XSLT loop.
Generally, a XSLT loops a node 1157,
and will print out all descendant if its document type is Dealitem, which is working already.
I am able to pull heading, subheading fields in loop. But tried many ways to get a media picker field called “featuredimg”, all failed.
umbraco.library:GetMedia(featuredimage,false()) - Failed
umbraco.library:GetMedia(current()/featuredimage,false()) - Failed
umbraco.library:GetMedia(./featuredimage,false()) - Failed
Error pops out when I try to save my XSLT file says:
“Saving XSLT file failed:
System.OverflowException: Value was either too large or too small for an Int32. …”
And I’ve attached my code below, can anyone help me with this please?
<xsl:for-each select=“umbraco.library:GetXmlNodeById(1157)/descendant::* [@isDoc and string(umbracoNaviHide) != ‘1’ and @nodeTypeAlias=‘Dealitem’]”>
<xsl:sort select=“@updateDate” order=“descending”/>
<xsl:if test=“position() > $itemsPerPage * number($pageNumber - 1) and
position() <= number($itemsPerPage * number($pageNumber - 1) + $itemsPerPage)”>
<xsl:value-of select=“@nodeName”/>
<xsl:variable name="img" select="umbraco.library:GetMedia(featuredimage,false())" />
<xsl:value-of select="$img/umbracoFile" />
</a>
</li>
</xsl:if>
</xsl:for-each>
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/71462-get-media-picker-image-in-xslt-loop