Returning specific image instead of 404

Posted by Community Admin on 03-Aug-2018 22:18

Returning specific image instead of 404

All Replies

Posted by Community Admin on 17-Jul-2014 00:00

We want to be able return a specific image that says "image not found" (rather than returning a 404 to the browser) when an IMG tag points to an non-existing file at our images library at /images/default-source/ for example. Is that possible to do through configuration, or customizing a provider?

Posted by Community Admin on 18-Jul-2014 00:00

Via Sitefinity, I doubt it. Via Javascript, you could do something like

<img src="xyz.gif" onError="this.onerror=null; this.src='notfound.gif';" />

or

$('img').error(function ()
  $(this).unbind('error').attr('src', 'notfound.gif');
);

Posted by Community Admin on 22-Jul-2014 00:00

Hello Eric,

You can find various samples here: jQuery/Javascript to replace broken images

Hope this helps.

Regards,
Vassil Vassilev
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 29-Jul-2014 00:00

Excellent suggestions,didn't think about handling it in the client side. Thanks!

This thread is closed