Hi all, I'm trying to call the media item by passing a macro variable to the GetMedia library.
I'm pretty close, but can't figure out how to pass the xsl variable to the select statement.
Here's what I have:
This is throwing an error "Value was either too large or too small for an Int32". I think it's because the $VideoURL isn't evaluating to the parameter.
Any help would be greatly appreciated.
FYI, I solved this.
It turned out not to be a true error, but an issue with the umbraco parser.
I clicked the Skip testing (ignore errors) option at the top of the xslt and this works fine now.
additionally, I added, a conversion for the macro parameter to a number in the variable definition.
Try checking the alternative 'Skip testing', and see if it works on the front end. If you pass $VideoURL as a macro parameter it is probably just not populated when the xslt is evaluated at save.
You can also change the xslt to something like this:
XSLT call library and pass xsl variable
Hi all, I'm trying to call the media item by passing a macro variable to the GetMedia library.
I'm pretty close, but can't figure out how to pass the xsl variable to the select statement.
Here's what I have:
This is throwing an error "Value was either too large or too small for an Int32". I think it's because the $VideoURL isn't evaluating to the parameter.
Any help would be greatly appreciated.
Thanks,
Zac
FYI, I solved this.
It turned out not to be a true error, but an issue with the umbraco parser.
I clicked the Skip testing (ignore errors) option at the top of the xslt and this works fine now.
additionally, I added, a conversion for the macro parameter to a number in the variable definition.
The error appears when saving I suppose?
Try checking the alternative 'Skip testing', and see if it works on the front end. If you pass $VideoURL as a macro parameter it is probably just not populated when the xslt is evaluated at save.
You can also change the xslt to something like this:
You found the answer while I was typing my response! Great!
If you put xsl:if around the GetMedia you will not have to remember to check Skip testing every time you modify the xslt.
Thanks for the response! I'll try the if test
is working on a reply...