In most cases the image is still around and every thing works fine. But in some cases the image doesn't exist and the img url is broken and as a result it displays the no image icon.
the thing is that I'm not sure how to make the loop detect if there is an actual file behind the img url or if the file is missing.
I've tried to use
but obviously the loop is reading the broken urls as imgs.empty, !empty, ==file, etc.
below is the loop I'm using, can someone please advise me
Code: Select all
{cgsi_getimages assign='imageinfo' nocontent=1}{$entry->content}{/cgsi_getimages}
{foreach from=$imageinfo[0].src item=image}
{if empty($image)}
<img src="uploads/images/img-01.jpg" class="sidebar-img" alt="{$entry->title}"/>
{else}
<img src="{$image}" class="sidebar-img" alt="{$entry->title}">
{/if}
{/foreach}