I'm trying to get the images (selected via a media picker) of the child nodes of a page to show on the parent page but I cant seem to get it right. Im getting an error that says "System.OverflowException: Value was either too large or too small for an Int32."
Try wrapping your productContainer div with the following - otherwise it can cause this error as Umbraco attempts to test your XSLT code when you save it, and if $productImageID is empty the GetMedia call will fail with the error you described.
Child media not showing
Hi!
I'm trying to get the images (selected via a media picker) of the child nodes of a page to show on the parent page but I cant seem to get it right. Im getting an error that says "System.OverflowException: Value was either too large or too small for an Int32."
The code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:for-each select="$currentPage/* [@isDoc]">
<xsl:variable name="productImageID" select="productImage"/>
<div class="productContainer">
<img class="productImage" src="{umbraco.library:GetMedia($productImageID, 'false')/umbracoFile}" />
<h2>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</h2>
<p class="productInfo">
<xsl:value-of select="productDescription"/><br />
<a href="{umbraco.library:NiceUrl(@id)}">
Mer info...
</a>
</p>
<p class="price">
Pris: <xsl:value-of select="productPrice"/> kr<br />
</p>
<a href="#" class="addToBasketButton">Lägg till</a>
<img class="hr" src="/media/179/hr.gif" alt="" />
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Hi,
Try wrapping your productContainer div with the following - otherwise it can cause this error as Umbraco attempts to test your XSLT code when you save it, and if $productImageID is empty the GetMedia call will fail with the error you described.
Hope this helps,
Tom
You, Sir, are awesome!
is working on a reply...