Closed GrantSmithDoddle closed 4 years ago
I realised that the code I'd been using was doing exactly what I was asking, pull all carousel images in.
My issue was then resolved with…
{% for img in carousel -%}
<div class="product_carousel_cell">
<figure class="outer-5by3">
<img class="inner-5by3" src="{{ img.image }}" alt="{{ img.imageAlt }}" loading="lazy" />
</figure>
</div>
{% endfor -%}
I am having an issue where my collection is outputting all data items from the whole collection, rather than the data from an individual post.
My products collection has a carousel of images for each product. Below is my front matter for this.
And I'm using this template to output.
For example, say I have the following products, 1, 2 and 3 in my products collection. My template is outputting
carousel.image
from products 1, 2 and 3 rather than just product 1.I was expecting only the
carousel.image
from a single product?