I have the 404 page setup as a single in sections under page404
.
I have a postImage
field that pulls images from assets. It is assigned to the page404
field layout and it is assigned in the entry.
I tried the this template approach:
{% set notFound = craft.entries.section('page404') %}
<img src="{{ notFound.postImage.first().url }}" width="800" height="800" alt="">
but I keep getting the following error:
Impossible to access an attribute ("url") on a null variable
What am I doing wrong, and how should it be template?