Hi,
So i am currently using the Narrative theme [email removed] version 10.6.0. and at the end of the description of all my products the images of all variants will be displayed. I want to change this to show a maximum of 6 images sorted by a line of 3 images and 2 rows. I looked at the product-template.liquid file at the product media gallery section and this is what i have:
{% endcomment %}
{%- if product.media.size > 1 -%}
{% comment %}
If we are hiding variant media which are displayed at the top of the
page, then find total number media not set as a variant media or as the
featured media.
We need the total number of media to be displayed so that we know what
arrangement the media need to be positioned in, i.e. rows of 3 or 2
media.
{% endcomment %}
{%- if section.settings.hide_variant_media -%}
{% assign variant_media_ids_array = variant_media_ids | split: ' ' %}
{% assign total_media = product.media.size | minus: variant_media_ids_array.size %}
{%- else -%}
{% assign total_media = product.media.size %}
{%- endif -%}
{% comment %}
Insert images into rows of 3 and/or 2 depending on the total number of
images.
{% endcomment %}
{% assign total_modulus = total_media | modulo: 3 %}
{% if total_media == 1 %}{% endif %}
{% for media in product.media %}
{% unless variant_media_ids contains media.id and section.settings.hide_variant_media %}
{% capture data_image %}
data-parent-fit="cover"
{% endcapture %}
{% include 'product-preview-image' with media, featured_media: false, gallery_type: 'submedia', data_image: data_image %}
{% endunless %}
{% endfor %}
{% if total_media == 1 %}
{% endif %}
{% endif %}
Below is an example of how the images are all displayed: