Copied to clipboard

Flag this post as spam?

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


  • Gary Pretty 5 posts 25 karma points
    May 31, 2011 @ 10:09
    Gary Pretty
    0

    Check if Image is Empty

    Hi,

    I am using the DAMP media picker in my umbraco installation and it works great.

    I have the following XSLT at the moment to display an image that has been uploaded and 'picked' using the plugin.

    Can anybody point me in the right direction as to how I can check to see if this image property has a value (i.e. an image has been chosen) so that I can hide the image element if not?

    Many thanks guys!

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <img src="{$currentPage/umbCategoryHeaderImage/DAMP[@fullMedia]/mediaItem/Image/umbracoFile}" />

    </xsl:template>

    </xsl:stylesheet

     

  • Daniel Bardi 927 posts 2562 karma points
    May 31, 2011 @ 11:35
    Daniel Bardi
    1
    <xsl:if test="$currentPage/umbCategoryHeaderImage/DAMP[@fullMedia]/mediaItem/Image != ''">
      <img src="{$currentPage/umbCategoryHeaderImage/DAMP[@fullMedia]/mediaItem/Image/umbracoFile}" />
    </xsl:if>

     

Please Sign in or register to post replies

Write your reply to:

Draft