Hi there!
having trouble accessing meta data from files.
I have a gallery and meta.yaml
files.
The name of files and meta filess follow the rules:
00x-image.jpg
00x-image.jpg.meta.yaml
Inside meta.yaml
file I’ve got the following information:
meta.alt_text: My alt text
meta.description: Description
And I’m publishing a photo gallery:
<div id="photoswipe-gallery-id" class="row justify-content-center">
{% for item in page.media.images %}
<a href="{{ item.url|e }}" class="gallery-item" data-size="{{ item.width ~ 'x' ~ item.height }}">
<img src="{{ item.cropResize(500, 250).url|e }}" loading="lazy" alt="{{ item.meta.alt_text }}"/>
</a>
{{ dump(item) }}
{% endfor %}
</div>
In the past project I’ve used to access meta data in such way: {{ item.meta.alt_text }}
But now I’m getting null
data.
The dump(item)
shows this information, and meta.alt_text
is present in array
But it seems I’m doing something wrong…