I'm trying to attach a custom header image for each entry, if none is selected then the default one will be displayed.
contentBuilder
is the Matrix field.imgHeader
is an assets block type.img
is the actual field
{% for content in entry.contentBuilder.type('imgHeader') %}
{% if content.img|length %}
{{ content.img.first.url }}
{% else %}
default jpg
{% endif %}
{% endfor %}
However this doesn't work. Please advise :)