This is a stripped down version of my code, but essentially whilst $test and $test2 render properly in the textarea, so i know the macro param value is being passed though into the xslt, if i try to use the variable pulled from the macro in $searchURL it doesn't even save properly.
I doubt i'm the first person to run into this, but my googling has been fruitless, anybody got any thoughts on how i can make this work?
okay, weirdness ensues. i can get it working now, but only if i force the save not to check for errors.
the resulting page renders fine, the xml is well-formed, nothing has exploded yet so i'm kinda assuming the web interface's error checker is doing something crazy.
Actually, that's exactly what's going on - when you save the file, Umbraco will perform a transformation with it - just to see if it's a valid XML file etc. - but that transformation won't have a useful $currentPage assigned, neither will it have values in the macro parameters (which values should it use?)
So usually you'd do some kind of safe-guarding to make sure there's a value in the variable before you use it - a la this:
Macro parameters - unable to use in XSLT variable?
I'm trying to pass a field value into aa variable in an XSLT however it's not working how i'd expected.
This is a stripped down version of my code, but essentially whilst $test and $test2 render properly in the textarea, so i know the macro param value is being passed though into the xslt, if i try to use the variable pulled from the macro in $searchURL it doesn't even save properly.
I doubt i'm the first person to run into this, but my googling has been fruitless, anybody got any thoughts on how i can make this work?
cheers
for what it's worth, directly pointing to $xmlAccount in the variable and using <xsl:variable name="test2"select="$xmlAccount"/> don't work either.
okay, weirdness ensues. i can get it working now, but only if i force the save not to check for errors.
the resulting page renders fine, the xml is well-formed, nothing has exploded yet so i'm kinda assuming the web interface's error checker is doing something crazy.
Hi ryan,
Actually, that's exactly what's going on - when you save the file, Umbraco will perform a transformation with it - just to see if it's a valid XML file etc. - but that transformation won't have a useful $currentPage assigned, neither will it have values in the macro parameters (which values should it use?)
So usually you'd do some kind of safe-guarding to make sure there's a value in the variable before you use it - a la this:
/Chriztian
is working on a reply...