# Variant Images Group

Preview for hiding other variant images:

{% embed url="<https://ascentelevated.myshopify.com/products/midtown-tennis-skirt8?variant=50047753912604>" %}

By adding the `alt` attribute to product images and grouping them by variant, you can achieve the effect of displaying only the image set for the currently selected variant. The specific steps are as follows:

<figure><img src="/files/WtEGY5ACQUjCZe07VdPb" alt=""><figcaption><p>Show Variant Image Group</p></figcaption></figure>

### Add the `alt` attribute to product images.

In the product editing page, select the images you want to group and add an `alt` attribute value, such as `###Purple`.\
Images with the same `alt` value (prefixed with `###`) will be grouped together.

{% hint style="warning" %}
The `alt` attribute value must be prefixed with `###` to enable the grouping functionality.
{% endhint %}

<figure><img src="/files/ewhhxygGAj0Yq2L6OnEW" alt=""><figcaption><p>Add Alt Attribute</p></figcaption></figure>

### Set variant images.

In the variant settings, assign a main image to each variant. All images in the same group as the main image will be displayed when that variant is selected.

<figure><img src="/files/60MAhpCufVeyfdDOPb8v" alt=""><figcaption><p>Set Variant Images</p></figcaption></figure>

### Enable the "Hide Other Variant Images" setting.

In the theme editor, go to the product settings and enable the "Hide Other Variant Images" option. Once enabled, only the current variant's image group will be displayed, while other images will be hidden.

<figure><img src="/files/IFH6bibQDD8HeOmulGE1" alt=""><figcaption><p>Enable Hide Other Variant Image Setting</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ascent.webvista.studio/pages/main-product/variant-images-group.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
