Fallback image if content_image is not set
Posted: Sun Jan 14, 2024 4:57 pm
In case the user does not provide a content_image I want to display a default (fallback) image. So I wrote these lines in my template:
This displays the content_image if it is set, but fails to display the fallback image.
I then tried content_image with a $ sign:
Now only the fallback image is displayed.
What am I missing?
Cheers,
Christian
Code: Select all
{if isset(content_image)}
{content_image dir="images/headers/" block='Header-Bild'}
{else}
<img src="/uploads/images/headers/header_default_o.jpg">
{/if}
I then tried content_image with a $ sign:
Code: Select all
{if isset($content_image)}
{content_image dir="images/headers/" block='Header-Bild'}
{else}
<img src="/uploads/images/headers/header_default_o.jpg">
{/if}
What am I missing?
Cheers,
Christian