Hi @lapinbleu007 ,
As far as I understand, you are trying to create a custom collection list.
You can replace the code inside the main-list-collections.liquid with the code below. Make sure to duplicate your theme prior to doing this.
{{ 'component-card.css' | asset_url | stylesheet_tag }}
{{ 'section-collection-list.css' | asset_url | stylesheet_tag }}
# {{ section.settings.title | escape }}
{%- liquid
case section.settings.sort
when 'products_high' or 'products_low'
assign collections = collections | sort: 'all_products_count'
when 'date' or 'date_reversed'
assign collections = collections | sort: 'published_at'
endcase
if section.settings.sort == 'products_high' or section.settings.sort == 'date_reversed' or section.settings.sort == 'alphabetical_reversed'
assign collections = collections | reverse
endif
-%}
{% for link in section.settings.all_collections.links %}
{% assign collection = link.object %}
- {% render 'card-collection', card_collection: collection, media_aspect_ratio: section.settings.image_ratio, columns: 3 %}
{%- endfor -%}
{% schema %}
{
"name": "t:sections.main-list-collections.name",
"class": "section",
"settings": [
{
"type": "text",
"id": "title",
"label": "t:sections.main-list-collections.settings.title.label",
"default": "Collections"
},
{
"type": "link_list",
"id": "all_collections",
"default": "main-menu",
"label": "t:sections.header.settings.menu.label"
},
{
"type": "select",
"id": "sort",
"options": [
{
"value": "alphabetical",
"label": "t:sections.main-list-collections.settings.sort.options__1.label"
},
{
"value": "alphabetical_reversed",
"label": "t:sections.main-list-collections.settings.sort.options__2.label"
},
{
"value": "date_reversed",
"label": "t:sections.main-list-collections.settings.sort.options__3.label"
},
{
"value": "date",
"label": "t:sections.main-list-collections.settings.sort.options__4.label"
},
{
"value": "products_high",
"label": "t:sections.main-list-collections.settings.sort.options__5.label"
},
{
"value": "products_low",
"label": "t:sections.main-list-collections.settings.sort.options__6.label"
}
],
"default": "alphabetical",
"label": "t:sections.main-list-collections.settings.sort.label"
},
{
"type": "select",
"id": "image_ratio",
"options": [
{
"value": "adapt",
"label": "t:sections.main-list-collections.settings.image_ratio.options__1.label"
},
{
"value": "portrait",
"label": "t:sections.main-list-collections.settings.image_ratio.options__2.label"
},
{
"value": "square",
"label": "t:sections.main-list-collections.settings.image_ratio.options__3.label"
}
],
"default": "adapt",
"label": "t:sections.main-list-collections.settings.image_ratio.label",
"info": "t:sections.main-list-collections.settings.image_ratio.info"
},
{
"type": "range",
"id": "columns_desktop",
"min": 1,
"max": 5,
"step": 1,
"default": 3,
"label": "t:sections.main-list-collections.settings.columns_desktop.label"
},
{
"type": "header",
"content": "t:sections.main-list-collections.settings.header_mobile.content"
},
{
"type": "select",
"id": "columns_mobile",
"options": [
{
"value": "1",
"label": "t:sections.main-list-collections.settings.columns_mobile.options__1.label"
},
{
"value": "2",
"label": "t:sections.main-list-collections.settings.columns_mobile.options__2.label"
}
],
"default": "2",
"label": "t:sections.main-list-collections.settings.columns_mobile.label"
}
]
}
{% endschema %}
You can see the full instructions here