Copied to clipboard

Flag this post as spam?

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


  • Kuda 21 posts 20 karma points
    Jun 10, 2009 @ 16:08
    Kuda
    0

    XSLT Media Picker

    So I am using this code to display an image using the media picker. It works to display an image that a user selectes from the GUI in Umbraco:





    ---------------------------------------

    The problem occurs when an image is not selected. When you view the web page this error shows up on the page:

    Error parsing XSLT file: \xslt\CEPSubImage.xslt

    To get around this I have been making the fields mandatory, but that is just short-term.


    Desired behavior: If an image is selected display it on the site. If not, do nothing.


    If someone could help me with the XSLT, I'd appreciate it.

    Kuda.

  • Daniel Lindstrom 454 posts 271 karma points
    Jun 10, 2009 @ 16:53
    Daniel Lindstrom
    0

    One more xsl:if would do it as getmedia fails if the property is empty:



  • Daniel Lindstrom 454 posts 271 karma points
    Jun 10, 2009 @ 16:57
    Daniel Lindstrom
    0

    Well, on second thought I guess you could skip the

  • Kuda 21 posts 20 karma points
    Jun 10, 2009 @ 17:10
    Kuda
    0

    BINGO. Thanks for the snappy response. The one IF statement did the trick.

    Cheers

Please Sign in or register to post replies

Write your reply to:

Draft