So i think your variablecollectionshouldbe, but i´m not sure. So I think the $mediapickerproperty must be declared before the $listImage, because you are using the value of the $mediapickerproperty inside the select statement of the $listImage
Hi Dennis, ok i understand now...i reordered the variables order but still gettin this error...am trying to figure out another path i found on this link
Get error - Value was either too large or too small for an Int32.
Hi All ,
Am gettin this erro when trying to save mu xslt...i know that its a problem with this line :
<xsl:variable name="listImage" select="umbraco.library:GetMedia($mediapickerproperty, 1)"/>
cos when i save skipping errors it works....
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage" />
<xsl:variable name="listImage" select="umbraco.library:GetMedia($mediapickerproperty, 1)"/>
<xsl:variable name="itemsPerPage" select="7"/>
<xsl:variable name="numberOfItems" select="count($listImage/Image)"/>
<xsl:variable name="pageNumber">
<xsl:choose>
<xsl:when test="umbraco.library:RequestQueryString('page') = ''">
<xsl:value-of select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="umbraco.library:RequestQueryString('page')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="mediapickerproperty" select="$currentPage/linkToGallery"/> <!-- datatype property for the mediapicker -->
<xsl:template match="/">
<xsl:if test="$mediapickerproperty > 0">
<xsl:for-each select="$listImage/Image">
<xsl:if test="position() > $itemsPerPage * number($pageNumber -1) and position() <= number($itemsPerPage * number($pageNumber -1) + $itemsPerPage)">
<div class="miniPhotoCn">
<div class="miniPhotoCnImg">
<a>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:GetMedia(@id, 0)/umbracoFile"/>
</xsl:attribute>
<xsl:attribute name="rel">
<xsl:value-of select="string('slideshow')"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@nodeName"/>
</xsl:attribute>
<img>
<xsl:attribute name="src">
<xsl:value-of select="umbraco.library:Replace(umbraco.library:GetMedia(@id, 0)/umbracoFile, '.', '_thumb.')"/>
</xsl:attribute>
</img>
</a>
</div>
</div>
</xsl:if>
</xsl:for-each>
</xsl:if>
<!-- PAGINATOR -->
<div class="paginatorCn">
<div class="paginator">
PAGE:
<!--<xsl:if test="$pageNumber > 1">
<a href="?page={$pageNumber -1}">previous</a>
</xsl:if>-->
<xsl:call-template name="for.loop">
<xsl:with-param name="i">1</xsl:with-param>
<xsl:with-param name="count" select="ceiling($numberOfItems div $itemsPerPage)"></xsl:with-param>
</xsl:call-template>
<!-- <xsl:if test="(($pageNumber) * $itemsPerPage) < ($numberOfItems)">
<a href="?page={$pageNumber +1}">next</a>
</xsl:if>-->
</div>
</div>
<!-- END PAGINATOR -->
</xsl:template>
<xsl:template name="for.loop">
<xsl:param name="i"/>
<xsl:param name="count"/>
<xsl:if test="$i <= $count">
<xsl:if test="$pageNumber != $i">
<a href="?page={$i}">
<xsl:value-of select="$i" />
</a>
</xsl:if>
<xsl:if test="$pageNumber = $i ">
<span class="IsActive">
<xsl:value-of select="$i" />
</span>
</xsl:if>
<xsl:call-template name="for.loop">
<xsl:with-param name="i" select="$i + 1" />
<xsl:with-param name="count" select="$count">
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
I know i must put an if statement somewhre for this variable...but can't figure out how..
Any help out there?
/Sam
Hi Sam,
I've looked at your code, and I think you get the error because you use the variable before you declare it.
<xsl:variable name="listImage" select="umbraco.library:GetMedia($mediapickerproperty, 1)"/>
You use it in this line, but declares the first lower down in your code before macth.
Maybe that's why you get the error. Hope at least it can help you.
/Dennis
Dennis,
its already it this order
<xsl:variable name="listImage" select="umbraco.library:GetMedia($mediapickerproperty, 1)"/>
<xsl:variable name="itemsPerPage" select="7"/>
<xsl:variable name="numberOfItems" select="count($listImage/Image)"/>
am declaring the varable before i used it below...double check it and seems to work if i skip error testing,,,any other clue??
Thks
/Sam
Hi again Sam,
What I meant by my explanation was that this variable $mediapickerproperty is first declared just before the template match, but using it in your <xsl: variable name = "list image" select = "umbraco.library: GetMedia ($mediapickerproperty, 1)" />.
So i think your variable collection should be, but i´m not sure. So I think the $mediapickerproperty must be declared before the $listImage, because you are using the value of the $mediapickerproperty inside the select statement of the $listImage
<xsl:variable name="mediapickerproperty" select="$currentPage/linkToGallery"/>
<xsl:variable name="listImage" select="umbraco.library:GetMedia($mediapickerproperty, 1)"/>
<xsl:variable name="itemsPerPage" select="7"/>
<xsl:variable name="numberOfItems" select="count($listImage/Image)"/>
I hope it makes sense, what I mean.
And hope it can help you further.
/Dennis
Hi Dennis, ok i understand now...i reordered the variables order but still gettin this error...am trying to figure out another path i found on this link
http://our.umbraco.org/forum/developers/xslt/1465-XSLT-Error-SystemOverflowException-Value-was-either-too-large-or-too-small-for-an-Int32-
do you think it might be something like this ? but now i must figure out where to put the if statement...
Your help is much appreciated.
/Sam
Hi Sam,
Yes it could be something like that, I think
I found another post on the same subject maybe it helps too.
http://our.umbraco.org/forum/developers/xslt/22124-Value-was-either-too-large-or-too-small-for-an-Int32-with-GetMedia
Don´t know if that will be the solution, but have you tried to add this to see if it worked?
<xsl:variable name="mediapickerproperty" select="number($currentPage/linkToGallery)"/>
<xsl:if test="number($mediapickerproperty) > 0">
/Dennis
Hi Dennis,
Back to work...sorry for late response..have tried your idea but still getting error..I will continue to browse forum for other clues..
Thks
/Sam
Ok figured it out just rewirte the variables like this :
<xsl:variable name="mediapickerproperty" select="$currentPage/linkToGallery"/> <!-- datatype property for the mediapicker -->
<xsl:variable name="itemsPerPage" select="7"/>
<xsl:variable name="numberOfItems">
<xsl:if test="$mediapickerproperty > 0">
<xsl:value-of select="count(umbraco.library:GetMedia($mediapickerproperty,1)/Image)"/>
</xsl:if>
</xsl:variable>
It does the trick..
/Sam
Okay, Sam, good to hear that you found a solution to your problem.
/Dennis
is working on a reply...