Hi,
I came across this code which allows me to create a customized collection slider with shapes and other options. I was able to create a collection slider block in my customize page, but for some reason, the images won’t show. Instead, it is showing this on the website
"Liquid error (sections/collection-slider line 133): Could not find asset snippets/card-collection.liquid "
Here is the code for reference:
{{ 'section-collection-list.css' | asset_url | stylesheet_tag }}
{{ 'component-card.css' | asset_url | stylesheet_tag }}
{%- style -%}
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
}
@media screen and (min-width: 750px) {
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top }}px;
padding-bottom: {{ section.settings.padding_bottom }}px;
}
}
{%- endstyle -%}
{%- liquid
assign columns_mobile_int = section.settings.columns_mobile | plus: 1
assign show_mobile_slider = false
if section.settings.swipe_on_mobile and section.blocks.size > columns_mobile_int
assign show_mobile_slider = true
endif
-%}
{% schema %}
{
"name": "Collection slider",
"tag": "section",
"class": "section section-collection-list",
"max_blocks": 15,
"settings": [
{
"type": "select",
"id": "image_ratio",
"options": [
{
"value": "adapt",
"label": "adapt"
},
{
"value": "portrait",
"label": "Portrait"
},
{
"value": "square",
"label": "Square"
},
{
"value": "circle",
"label": "Circle"
}
],
"default": "circle",
"label": "Image ratio"
},
{
"type": "range",
"id": "columns_desktop",
"min": 1,
"max": 8,
"step": 1,
"default": 4,
"label": "Number of columns on desktop"
},
{
"type": "select",
"id": "color_scheme",
"options": [
{
"value": "accent-1",
"label": "Accent 2"
},
{
"value": "accent-2",
"label": "Accent 1"
},
{
"value": "background-1",
"label": "Background 1"
},
{
"value": "background-2",
"label": "Background 2"
},
{
"value": "inverse",
"label": "inverse"
}
],
"default": "background-1",
"label": "Color scheme",
"info": "To change the card color scheme, update your theme settings."
},
{
"type": "header",
"content": "Mobile Layout"
},
{
"type": "range",
"id": "columns_mobile",
"min": 1,
"max": 8,
"step": 1,
"default": 4,
"label": "Number of columns on mobile"
},
{
"type": "checkbox",
"id": "swipe_on_mobile",
"default": true,
"label": "Enable swipe on mobile"
},
{
"type": "header",
"content": "Section padding"
},
{
"type": "range",
"id": "padding_top",
"min": 0,
"max": 100,
"step": 4,
"unit": "px",
"label": "Top padding",
"default": 36
},
{
"type": "range",
"id": "padding_bottom",
"min": 0,
"max": 100,
"step": 4,
"unit": "px",
"label": "Bottom padding",
"default": 36
}
],
"blocks": [
{
"type": "featured_collection",
"name": "Collection",
"settings": [
{
"type": "collection",
"id": "collection",
"label": "Collection"
}
]
}
],
"presets": [
{
"name": "Collection slider",
"blocks": [
{
"type": "featured_collection"
},
{
"type": "featured_collection"
},
{
"type": "featured_collection"
}
]
}
]
}
{% endschema %}
Hope you could help me out! Credits to mrdigitals.com for the code.
Thank you!
