Copied to clipboard

Flag this post as spam?

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


  • Vincent Ashby-Smith 67 posts 196 karma points
    Jan 22, 2010 @ 11:41
    Vincent Ashby-Smith
    0

    Why can't i do this?

    Hi all i'm trying to access a flash video for use in a lightbox and i need to set the href to being the location fo the flash video, so i want to use the GetMedia as i'm selecting the flash video using the media picker, however this seems to error, but not sure why!?

    <a title="{$currentPage/data [@alias='caseStudyFlashVideoHeaderText']}" href="{umbraco.library:GetMedia($currentPage/data [@alias='flashVideo'],
     'false')/data [@alias='umbracoFile']}"><xsl:value-of select="$currentPage/data[@alias='caseStudyFlashVideoHeaderText']" /></a>
    

     

     

  • Seth Niemuth 275 posts 397 karma points
    Jan 22, 2010 @ 11:46
    Seth Niemuth
    0

    Does it error when you are saving the XSLT or does it say there is a problem in the XSLT on the page?

    If it does it when saving the XSLT, what is the error that it is giving?

    Double check that the alias names are exactly correct (including case).

  • Vincent Ashby-Smith 67 posts 196 karma points
    Jan 22, 2010 @ 11:50
    Vincent Ashby-Smith
    0

    Names are definately correct, this is the error i get: System.OverflowException: Value was either too large or too small for an Int32.

  • Vincent Ashby-Smith 67 posts 196 karma points
    Jan 22, 2010 @ 11:54
    Vincent Ashby-Smith
    1

    Solved it by putting a if round it!!

    <xsl:if test="$currentPage/data[@alias='flashVideo'] != '' ">
      <p><a title="{$currentPage/data [@alias='caseStudyFlashVideoHeaderText']}"
       
       href="{umbraco.library:GetMedia($currentPage/data[@alias='flashVideo'], 'false')/data[@alias = 'umbracoFile']}">
       <xsl:value-of select="$currentPage/data [@alias='caseStudyFlashVideoHeaderText']" /></a></p>
    </xsl:if> 

  • Seth Niemuth 275 posts 397 karma points
    Jan 22, 2010 @ 11:58
    Seth Niemuth
    0

    You will need to wrap what you have in an if statement:

    <xsl:if test="$currentPage/data [@alias='flashVideo'] >0">
    <a title="{$currentPage/data [@alias='caseStudyFlashVideoHeaderText']}" href="{umbraco.library:GetMedia($currentPage/data [@alias='flashVideo'],'false')/data [@alias='umbracoFile']}"><xsl:value-of select="$currentPage/data[@alias='caseStudyFlashVideoHeaderText']" /></a>
     </xsl:if>

     

    so that it doesn't error if you happen to put this macro on a page where it can't find the 'flashVideo' property.

  • Seth Niemuth 275 posts 397 karma points
    Jan 22, 2010 @ 11:58
    Seth Niemuth
    0

    good...you beat me to the answer.

Please Sign in or register to post replies

Write your reply to:

Draft