How do I include a season image in a template, but only if the image exists? Currently I am using season.image.html()
and it creates some broken images.
Hmm, that might not be possible. Is there a reason why you don’t want to add an image to every season? Maybe add the podcast cover if you don’t have a dedicated season image?
In this case I am maintaining a podcast where they started adding season images at one point so older seasons do not have an image.
I figured it out!
{% if season.image.url is not empty %}
1 Like