Mhm, I don’t know exactly if this will work, but should be something like this for your case:
{% for img in header.referenties %}
<img src="{{ url('theme://images/) }},{{ img.image }}" alt="{{ img.text }}" />
{% endfor %}
Could also be img.image.name
Very helpful in general is installing the developer tools and tracing out vars to find out what it is or if that array stores relevant information
{% for img in header.referenties %}
{{ dump( img) }} <!-- logs maybe an array? -->
{{ dump( img.name) }} <!-- logs maybe the name ? -->
{{ dump( img.url) }} <!-- logs maybe the url -->
{{ dump( img.text) }} <!-- should log your 'Referentie beschrijving' ? -->
{% endfor %}
The documentation is pretty well. Although sometimes I miss in the blueprints form examples their relevant links to “how to” examples to get that data working within twig.
I am kind of new to grav and I didn’t know about the debug functionality. Thanks for that!
I finally found a solution thanks to debugging:
In my blueprint I changed the destination to:
destination: 'self@'
and this is the code in my template file:
{% for data in header.referenties %} {# Loops over the values of referenties -> referenties is an array #}
{% for img in data.image %} {# Loops over the values of image -> image is also an array #}
{{ page.media[img.name].html }} {# Displays the image #}
{% endfor %}
{% endfor %}
Btw I totally agree with you about the documentation. Let’s hope it gets better in the future.