Code: Select all
{if file_exists($entry->fields.Image2)}
<div class="col-md-6">
<img src="{$entry->file_location}/{$fields.Image2->displayvalue}{$entry->fields.Image2->displayvalue}" class="img-responsive">
</div>
{/if}
if I write it with " !file_exists " the image is showing.
I have also written it like "{if file_exists($entry->fields.Image2)== false}"
but it gives the same result
Some of my posts have an image in this custom field and others don't.
those how don't have it always shows a broken image.
Is there another way to do this kind of operation or am I misunderstanding something?