I've got a Assets field which is limited to 1 asset inside a Matrix field. Is there a better way to fetch the image without using a forloop?
At the minute I've got:
{% for image in block.backgroundImage %}
{{ image.getUrl() }}
{% endfor %}
But it just doesn't seem right using a forloop when I know there is only one image.
Thanks
{% block.backgroundImage | length ? block.backgroundImage.first().getUrl() : '' %}:D – Josh Angell Jul 29 '14 at 05:35