Accessories

{% if section.settings.title != blank %}

{{ section.settings.title | escape }}

{% endif %} {% case section.settings.grid %} {% when '2' %} {%- assign grid_item_width = 'medium-up--one-half' -%} {%- assign image_size = '530x' -%} {% when '3' %} {%- assign grid_item_width = 'small--one-half medium-up--one-third' -%} {%- assign image_size = '350x' -%} {% when '4' %} {%- assign grid_item_width = 'small--one-half medium-up--one-quarter' -%} {%- assign image_size = '250x' -%} {% when '5' %} {%- assign grid_item_width = 'small--one-half medium-up--one-fifth' -%} {%- assign image_size = '225x' -%} {% endcase %}
{% for block in section.blocks limit: section.blocks.size %}
{%- assign collection = collections[block.settings.collection] -%} {% include 'collection-grid-item', collection_image_size: image_size %}
{% endfor %}
{% if section.blocks.size == 0 %} {% include 'no-blocks' %} {% endif %}
{% schema %} { "name": "Collection list", "class": "index-section", "max_blocks": 12, "settings": [ { "type": "text", "id": "title", "label": "Heading", "default": "Collection list" }, { "type": "select", "id": "grid", "label": "Collections per row", "default": "3", "options": [ { "value": "2", "label": "2" }, { "value": "3", "label": "3" }, { "value": "4", "label": "4" }, { "value": "5", "label": "5" } ] } ], "blocks": [ { "type": "featured_collection", "name": "Collection", "settings": [ { "label": "Collection", "id": "collection", "type": "collection" } ] } ], "presets": [ { "name": "Collection list", "category": "Collection", "settings": { "grid": "3" }, "blocks": [ { "type": "featured_collection" }, { "type": "featured_collection" }, { "type": "featured_collection" } ] } ] } {% endschema %}