So i built a simpel slideshow macro (code below). Which all works great except for one detail. I'm not using my "source" variable to get the right folder in the media library. The problem is when i try to, that is replace "1198" with "$source", it says: "System.OverflowException: Value was either too large or too small for an Int32."
The weird think is that i'm using it in the line above "s{$source"}" .. were it correctly returns "s1198". What am i doing wrong, since it doesn't want to recognize my variable as an Int32?
Having trouble using variable from macro
So i built a simpel slideshow macro (code below). Which all works great except for one detail. I'm not using my "source" variable to get the right folder in the media library. The problem is when i try to, that is replace "1198" with "$source", it says: "System.OverflowException: Value was either too large or too small for an Int32."
The weird think is that i'm using it in the line above "s{$source"}" .. were it correctly returns "s1198". What am i doing wrong, since it doesn't want to recognize my variable as an Int32?
<?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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets "> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <xsl:variable name="source" select="/macro/source"/> <xsl:template match="/"> <div class="slideshow s{$currentPage/@id} s{$source}"> <xsl:for-each select="umbraco.library:GetMedia(1198, 'false')/node"> <xsl:choose> <xsl:when test="umbraco.library:GetMedia(@id, 'false')/data [@alias = 'umbracoFile']"> <img src="{umbraco.library:GetMedia(@id, 'false')/data [@alias = 'umbracoFile']}" alt="{@nodeName}" /> </xsl:when> <xsl:otherwise> <!--Do something with the directory--> </xsl:otherwise> </xsl:choose> </xsl:for-each> </div> </xsl:template> </xsl:stylesheet>You can find the solution here
http://forum.umbraco.org/yaf_postst3143_NiceUrl-failing-on-valid-node.aspx
Rich
Wrapping
around did the trick. Thanks Rich.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.