Hello,
Could someone please help me figure out where the issue is with this code? I am just trying to have a page that automatically loads the “YMCA” Collection.
Thanks! (Code Below)
Nick
{% for collection in collections %}
{% if collection.title == ‘YMCA’ %}
{% paginate collection.products by 12 %}
{{ collection.title }}
{% if collection.description != blank %}{% assign blocks_size = section.blocks | size %}
{% if blocks_size > 0 %}
{% if paginate.pages > 1 %}
{% include ‘pagination’ %}
{% endif %}
{% style %}
.collection-grid-container {
background-color: {{ section.settings.background_color | default: ‘transparent’ }};
}
.collection__grid-item img {
border-radius: {{ section.settings.image_border_radius }}%;
{% if section.settings.image_border %}
border: 1px solid {{ settings.color_border }};
{% endif %}
}
{% if section.settings.product_text_color %}
.collection__grid-item .product__title,
.collection__grid-item.collection__grid-item–text-under .product__title {
color: {{ section.settings.product_text_color }};
}
.collection__grid-item .collection__grid-item__price,
.collection__grid-item .compare-price {
color: {{ section.settings.product_text_color }};
}
{% endif %}
{% endstyle %}
{% schema %}
{
“name”: “Collection Page”,
“max_blocks”: 4,
“settings”: [
{
“type”: “color”,
“id”: “background_color”,
“label”: “Collection grid background color”
},
{
“type”: “color”,
“id”: “product_text_color”,
“label”: “Grid item text color”
},
{
“type”: “select”,
“id”: “items_per_row_desktop”,
“label”: “Items per row [Desktop]”,
“options”: [
{
“label”: “2”,
“value”: “two”
},
{
“label”: “3”,
“value”: “three”
},
{
“label”: “4”,
“value”: “four”
},
{
“label”: “5”,
“value”: “five”
}
],
“default”: “three”
},
{
“type”: “select”,
“id”: “items_per_row_mobile”,
“label”: “Items per row [Mobile]”,
“options”: [
{
“label”: “1”,
“value”: “one”
},
{
“label”: “2”,
“value”: “two”
}
],
“default”: “one”
},
{
“type”: “checkbox”,
“id”: “enable_prices”,
“label”: “Show product prices”,
“default”: true
},
{
“type”: “range”,
“id”: “image_border_radius”,
“label”: “Image rounded corners”,
“min”: 0,
“max”: 50,
“step”: 1,
“unit”: “%”,
“default”: 0
},
{
“type”: “checkbox”,
“id”: “image_border”,
“label”: “Image border”,
“default”: true
}
],
“blocks”: [
{
“type”: “icon-bar”,
“name”: “Icon Bar”,
“settings”: [
{
“type”: “image_picker”,
“id”: “icon_bar_img”,
“label”: “Icon”
},
{
“type”: “text”,
“id”: “icon_bar_text”,
“label”: “Icon text”
}
]
}
]
}
{% endschema %}