Image grid
A gallery of extra images pulled from the custom.gallery metafield — masonry or fixed-ratio grid with an optional zoom lightbox.
Image grid is a second gallery further down the page: detail shots, process pictures, a lookbook. You set the section up once. After that, adding images is an admin job. The images come from the custom.gallery metafield on a product, page, blog, blog post or collection.
How to add
Good to know
The editor is not a preview of the live page here. Placeholders only appear inside Customize. On the published store the section either shows the metafield images or produces no output: no empty block, no padding.
Which metafield is read depends on the template. On a product template it reads the product's
custom.gallery, on a page the page's, on a blog or blog post the blog's or the article's, on a collection the collection's. The home page, cart, search and account templates match none of these, so the section is empty there unless you use the Page setting to point at a page that has the metafield.Only images are rendered. Videos, PDFs and other files in the metafield list are dropped, so a gallery can come out shorter than the list in the admin.
The Original ratio uses a masonry layout. Images keep their own proportions and are packed by height. The layout is calculated after the images load, so on a slow connection the grid may briefly settle into place. Every other ratio is a plain grid and crops to the ratio you chose around the Focal point.
A single image forces a one-column mobile layout, whatever the mobile setting says.
The zoom style changes what the other zoom settings do. With the default or slideshow style the images open in a lightbox. With the zoom-in style they magnify on hover, and the lightbox never opens. The overlay, media ratio, image width and mobile arrow settings then have no effect.
The zoom has its own ratio and focal point. Media ratio and the Focal point inside the zoom group crop the enlarged image independently of the grid, so a square grid thumbnail can open as a tall full-length shot. Overlay follows the store's default backdrop until you override it here with your own colour, opacity and background blur.
Add only one Image grid block per blog post. Two blocks on the same article share one lightbox, so clicking an image in the second grid opens the images from the first.
Desktop and mobile switch at different widths. The number of columns changes to the mobile value at 500 px, while the section paddings change at 920 px. Tablet-width screens use desktop columns with mobile padding.
Disabling the left and right page padding forces the section to full width, overriding the Section width setting.
Customization ideas
Keep Image ratio on Original for lookbooks and process photography, and switch to a fixed ratio for catalogue-style grids that need to line up.
Use the Page setting to build a standalone gallery page: one page metafield, one section, no product involved.
Two columns on desktop with the original ratio gives a magazine spread. Five or six columns turn the same images into a contact sheet.
Set a tighter mobile spacing than desktop (the defaults are 8 px and 4 px) so the grid reads as one block on a phone.
Turn the zoom overlay to a custom colour with a background blur for a gallery that feels closer to a photo app than a storefront.
Best practices
Define the metafield once, for every resource type you plan to use it on, before you add the section anywhere. Most empty galleries are a metafield that exists on Products but not on Pages.
Keep the files small. This is a second gallery on top of the product media, and it is downloaded on every visit. See Image & video size recommendations.
Fill the alt text on the files in the admin. It is used on the grid images and is the only description a screen reader gets.
Put the section below the product details. It is supporting material, not the buying decision.
Check a product that has no gallery on the live storefront as well as one that does. The section should simply vanish.
Related
Was this helpful?
