Shopify themes, liquid, logos, and UX
Instead of returning "product.images" how to return "product.image #1", "product.image #2" as individual URLs
--what I have--
INPUT
{% for image in product.images %}
{{ image | image_url: width: 300 }}
{% endfor %}
OUTPUT
https://cdn.shopify.com/s/files/1/1183/1048/products/boat-shoes.jpeg?v=1459175177&width=300
https://cdn.shopify.com/s/files/1/1183/1048/products/boat-shoes-back.jpeg?v=1425177&width=300
https://cdn.shopify.com/s/files/1/1183/1048/products/boat-shoes-bottom.jpeg?v=134351&width=300
-=-=-=-=-=-=-=
--what I need--
INPUT
{% call only for product.image #1 %}
OUTPUT
https://cdn.shopify.com/s/files/1/1183/1048/products/boat-shoes.jpeg?v=1459175177&width=300
+
INPUT
{% call only for product.image #2 %}
OUTPUT
https://cdn.shopify.com/s/files/1/1183/1048/products/boat-shoes-back.jpeg?v=1425177&width=300
It makes sense to sanity check if an image actually exists before using but this should let you specifiy an image at an index.
{% assign specificImage = product.images[0] %}
{{ specificImage | image_url: width: 300 }}
--------------
{% assign specificImage = product.images[1] %}
{{ specificImage | image_url: width: 300 }}
Thanks, how can i return product image
User | RANK |
---|---|
140 | |
114 | |
79 | |
64 | |
64 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023