Image gallery: Image source
The Image gallery section can show images you add yourself, or pull them from the product automatically, so one product template shows the right photos for every product.
Find it in the section settings under Image source.
Options
| Option | Shows |
|---|---|
| Manual | The images you add as blocks in the section. |
| Product media | All images of the product being viewed. |
| Product metafield | The images in a product metafield, so you can pick a different set from the main product photos (e.g. lifestyle shots). |
Important: Product media and Product metafield only work when the section is on a product page template. Anywhere else, the gallery shows the Manual images instead.
Use a product metafield
1. From your Shopify admin, go to Settings > Metafields and metaobjects > Products, then click Add definition.
2. Enter:
-
Name:
Gallery -
Namespace and key:
custom.gallery -
Type: File, then choose List of files and allow Images.
3. Click Save.
4. Open each product, scroll to Metafields, add images to Gallery, then click Save.
5. In the theme editor, open the product template, select the Image gallery section, set Image source to Product metafield, and make sure Metafield says custom.gallery.
Tip: You can use a different key, for example
custom.lifestyle_images. Just enter the samenamespace.keyin the Metafield field.
Image size and shape
With Product media or Product metafield:
-
If the section has no image blocks, every image uses Image width, Image width mobile and Aspect ratio.
-
If the section has image blocks, each image takes the width and aspect ratio of a block, in order: image 1 uses block 1, image 2 uses block 2, and so on, starting over after the last block. Use this to create a varied layout. Delete the blocks if you want all images the same size.