For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Display only media related to chosen variant

Show the photos, videos, and models of the selected color in the product gallery. Each file's alt text ends with that color's option value in parentheses.

Black / S and Black / M share one set of files, because both variants use the color Black. Size and every other option leave the gallery unchanged.

Theme Editor → Products → [your product template] → Product overview → Show only media of selected variant

The same switch is on the Quick view template and on a Featured product section. Turn it on for each template that uses the gallery.


1

Set the color option

Avante needs to know which product option holds the color. If the option is named Color or Colour, there is nothing to do — the theme finds it on its own. For any other name, open Theme settings → Product card → Color labels and list the names separated by commas: Color, Shade, Finish. The same field also drives the color swatches on product cards.

Color labels in detail
  • On a translated storefront the theme looks for the translated word — Farbe, Couleur, Colore — so the field still stays empty.

  • Capitalization is ignored.

  • A filled field replaces the automatic rule. Include every color option name the catalog uses, Color among them, or the ones you left out stop being recognised.

  • When a product has two options that both count as colors, the gallery follows the first one in the product’s option list.

2

Label each media file

Open Shopify Admin → Products → [your product] → Media and edit each file on its own. In the alt text, end with the color’s option value in parentheses: a black photo might read Front view (Black), a blue one On model (Ocean Blue). The value in parentheses is what shoppers see on the swatch.

The alt text stays a real description — the color in parentheses is appended at the end. Each file carries its own color value.
The alt text stays a real description — the color in parentheses is appended at the end. Each file carries its own color value.
How the theme reads the parentheses
  • Capitalization is ignored: (Black) and (black) are the same color.

  • Spaces stay as spaces, so the option value Ocean Blue matches (Ocean Blue).

  • If the alt text has several pairs of parentheses, Avante uses the last pair.

3

Assign the opening image

Open Variants and assign that color's opening image to one variant of the color, for example Black / S. The gallery opens on this image. Repeat for every color.

4

Enable the setting

In the product template, open Product overview and turn on Show only media of selected variant.

Photos of packaging, the brand, or the product as a whole apply to every color. Leave the parentheses out of their alt text, and turn on Show also general product media in the same section. With that setting off, those files stay hidden.


Common issues

Only one file is visible

The other files are hidden because their alt text does not match the color value. Open Media and compare the text in parentheses with the option value. An untouched alt text that only repeats the product title does not count as a match.

Lifestyle photos disappear, or they show on every color

Files with no color in parentheses are general media. They stay in the gallery for every color when Show also general product media is on. With that setting off, they stay hidden.

The filter works on one product and skips another

Each product template has its own switch. Open Theme Editor → Products → [that template] → Product overview and turn on Show only media of selected variant. Do the same on Quick view when the popup uses this gallery.

Last updated

Was this helpful?