> For the complete documentation index, see [llms.txt](https://en-ascent.webvista.studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://en-ascent.webvista.studio/pages/main-product/variant-images-group.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
