For now I'm just worrying about the default case, rather than getting the value from the Request. I've checked the parameters with xsl:copy-of statments and they're getting passed in correctly, and I've checked my xsl by making $mediaId hard-coded, and it all works fine, however, whenever I try the full thing I get the following error on saving my xslt:
System.OverflowException: Value was either too large or too small for an Int32.
It's definately coming from the statement that's assigning a value to $mediaId, but I can't for the life of me figure out why? What's the glaringly obvious mistake I've made?
Multiple variables in select from Macro Parameters
Hi All,
I'm struggling with what is obviously a very simple task, I can't figure out why my xslt select won't work.
Following the examples from these threads: http://our.umbraco.org/forum/developers/xslt/21244-Multiple-variables-in-select, http://our.umbraco.org/forum/developers/xslt/20270-Multiple-parameters-in-xlst-select I'm using the following code to output the value of a particular page property, and choosing which property dynamically though a parameter to my macro.
I have the following XSLT:
Which is connected to a macro with a text parameter "heroImage" and is called from my template like this:
For now I'm just worrying about the default case, rather than getting the value from the Request. I've checked the parameters with xsl:copy-of statments and they're getting passed in correctly, and I've checked my xsl by making $mediaId hard-coded, and it all works fine, however, whenever I try the full thing I get the following error on saving my xslt:
System.OverflowException: Value was either too large or too small for an Int32.
It's definately coming from the statement that's assigning a value to $mediaId, but I can't for the life of me figure out why? What's the glaringly obvious mistake I've made?
Thanks,
Steve
Hi Steeve
Can you try this
Hey, that works! Thanks very much. Can you explain why it works? Do I need to do this every time I use a parameter in this way?
Hi Steven,
The error occurs because the GetMedia() function is called with an empty string instead of an ID.
Check my answer here for a "safe" way to handle media.
/Chriztian
Thanks Chriztian, it makes more sense now!
Nice one Chriztian....
is working on a reply...