Copied to clipboard

Flag this post as spam?

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


  • Mridul Thomas 8 posts 28 karma points
    Sep 07, 2012 @ 10:06
    Mridul Thomas
    0

    How to set a "No Image" pic when an image is not available

    Can you please help me setting a "No Image" picture when the image set is not avaiable?

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Sep 07, 2012 @ 10:21
    Bjarne Fyrstenborg
    0

    Hi..

    Are you using XSLT?

    Then you can do like this:

    <img src="{concat('/ImageGen.ashx?altImage=no_image.gif&transparent=false&bgcolor=ffffff&Image=',$mediaImage/umbracoFile,'&Width=',250)}" 
    alt="{$mediaImage/@nodeName}" width="250" /> 

    /Bjarne

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Sep 17, 2012 @ 12:00
    Douglas Robar
    0

    That's what the &altImage= parameter is for. If the &image= parameter isn't found then the altImage parameter is used instead. 

    All you need to do is include the filename (and path if needed) to the image to display if the main image isn't available. Really handy for product catalogues, head shots of personnel, etc.

    cheers,
    doug. 

Please Sign in or register to post replies

Write your reply to:

Draft