Add captions or labels to product images

Product images don't have metadata which could be used as captions in your Liquid templates. Many shops have worked around this by using the product image filename to come up with a descriptive caption using Liquid filters.

An alternative solution

When each product image illustrates a variant (and only one image does), and when your product images are dragged and dropped in the same order as your variants are listed, you can use this Liquid for your image caption:


{% for image in product.images %}
...
My image caption is {{ product.variants[forloop.index0].title }}
...
{% endfor %}

The variant title becomes your image caption.

Want to discuss this page?

Visit the Shopify Community