Goal: show an external image as the first product preview only within a specific collection, without adding it to the product’s own media.
Initial approach: Add conditional logic in snippets/product-media-gallery.liquid (after the line checking selected_or_first_available_variant.featured_media) to detect if a product is in a specific collection, then render a custom image first.
Sample logic: if product belongs to “My Collection,” output the external image before the default gallery.
Update/issue: This single-image approach doesn’t work because each product in the collection needs its own unique image.
Recommended solution: Use product Metafields (custom fields) to store a per‑product image URL. Upload images under Content → Files and reference the URL in a metafield (e.g., MainBlockImage).
Template logic: If the metafield exists (and optionally if the product is in the target collection), render that image first; otherwise fall back to the default featured media/gallery.
Status: Feasible but a larger customization. No final code provided; guidance given on structure and where to implement. Discussion remains open.
Summarized with AI on December 15.
AI used: gpt-5.
is it possible for an external image not present in the product to be loaded as a preview image for a specific collection? The image should only be loaded in the selected collection and should not be loaded generally in every collection. Also important, it should/may not appear in the product images.
Unfortunately this doesn’t work somehow. The collection also contains several products that require a respective image, not all of them the same. I forgot to mention that at the beginning. I think this is a much bigger effort, right?