Liquid, JavaScript, themes, sales channels
Context:
Challenge:
Ask:
Thanks!
@Boyi wrote:
- Within the product media, the scene image is directly after the featured image
{{ products.media[1] }}
https://shopify.dev/docs/api/liquid/objects/product#product-media
https://shopify.dev/docs/api/liquid/basics#array
@Boyi wrote:How to identify what is the number of the featured image in the overall media array?
.position property https://shopify.dev/docs/api/liquid/objects/media#media-position
Important point a variants featured_image is the only image attached to the variant atow.
https://shopify.dev/docs/api/liquid/objects/variant#variant-featured_image
So is this only needing the 2nd image/media out of the product media array or the only image on a variant.
If needing the product featured_image is there a reason the featured_image is not normally the first.
@Boyi wrote:
- Any other way to call the corresponding colour scene image to display on hover?
It's not uncommon for stores to use the ALT text with a naming convention to parse|liquid-filter for associating different images with different things like a color variant-options. 💣 While still trying to be valuable semantic information for accessibility concerns and SEO, i.e. "Color: Brown, picture of a leather couch with legs raising it off the floor".
Also see https://shopify.dev/docs/api/liquid/objects/image#image-attached_to_variant?
Save time & money ,Ask Questions The Smart Way
Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Buy Paul a ☕ Coffee for more answers or donate to eff.org
User | RANK |
---|---|
38 | |
28 | |
13 | |
13 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023