templates/page.gallery-data.liquid

{%- layout none -%}
{%- assign gallery_items = shop.metaobjects.gallery_item.values -%}
{%- assign item_count = 0 -%}
[
{%- for item in gallery_items -%}
  {%- assign g_status = item.status.value -%}
  {%- if g_status == "Active" -%}
    {%- if item_count > 0 -%},{%- endif -%}
    {
      "id": {{ item.system.handle | json }},
      "sku": {{ item.product_category.value.code.value | append: "-" | append: item.theme.value.code.value | append: "-" | append: item.sub_theme.value.code.value | append: "-" | append: item.system.handle | json }},
      "category": {{ item.product_category.value.name.value | json }},
      "category_code": {{ item.product_category.value.code.value | json }},
      "theme": {{ item.theme.value.name.value | json }},
      "theme_code": {{ item.theme.value.code.value | json }},
      "subtheme": {{ item.sub_theme.value.name.value | json }},
      "subtheme_code": {{ item.sub_theme.value.code.value | json }},
      "image": {{ item.primary_image.value | image_url: width: 800 | json }},
      "description": {{ item.description.value | default: "" | json }}
    }
    {%- assign item_count = item_count | plus: 1 -%}
  {%- endif -%}
{%- endfor -%}
]