{% if page.positions %} {% for position in page.positions.all %} {% if position.image %} {% endif %} {% if position.caption %} {{ position.caption.content }} {% endif %} {% endfor %} {% else %} No images or captions added. {% endif %}