Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Zac 239 posts 541 karma points
    May 12, 2009 @ 23:22
    Zac
    0

    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

  • Zac 239 posts 541 karma points
    May 13, 2009 @ 07:17
    Zac
    0

    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.






  • Daniel Lindstrom 454 posts 271 karma points
    May 13, 2009 @ 07:19
    Daniel Lindstrom
    0

    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:


  • Daniel Lindstrom 454 posts 271 karma points
    May 14, 2009 @ 09:03
    Daniel Lindstrom
    0

    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.

  • Zac 239 posts 541 karma points
    May 14, 2009 @ 21:57
    Zac
    0

    Thanks for the response! I'll try the if test

Please Sign in or register to post replies

Write your reply to:

Draft