I have an image saved and set in my site yaml config file:
gv:
map_image:
user/themes/site/assets/map.jpg:
name: map.jpg
type: image/jpeg
size: 123514
path: user/themes/site/assets/map.jpg
The image exists in the correct directory but I can’t get it to display in the page:
{% for item in site.gv.map_image %}
<img src="{{ page.media[item.name].cropZoom(1200,350).quality(100).url() }}" alt="">
{% endfor %}
If I run a test like this:
{% for item in site.gv.map_image %}
{{ item.name }}
{% endfor %}
It outputs the name fine and any other var, it’s just not outputting the image in Grav’s image function thing. Is that because it’s not in the page and so the ‘page.media’ function isn’t working? I don’t really understand how it works…