I need help in showing collections in a tab. Here’s a short video of what I’m trying to do
https://share.vidyard.com/watch/CTpNe1a2W2akBv3g4SA9Ug?
Here’s my code:
{% for block in section.blocks %}
{% if section.settings.show_button %}{% endif %}
{% for collection in collections %}
{% if collection.title != blank %}
{{ collection.title }}
{% else %}
Add collections
{% endif %}
{% endfor %}
{% endfor %}
And the schema is here:
{% schema %}
{
"name": "Collection Switch Menu",
"tag": "div",
"max_blocks": 12,
"settings": [
{
"type": "text",
"id": "title",
"label": "Collection Switch list"
},
{
"type": "checkbox",
"id": "show_button",
"default": false,
"label": "Show Button"
}
],
"blocks": [
{
"type": "featured_collection",
"name": "t:sections.collection-list.blocks.featured_collection.name",
"settings": [
{
"type": "collection",
"id": "collection",
"label": "Choose Collections"
}
]
}
],
"presets": [
{
"name": "t:sections.collection-list.presets.name",
"blocks": [
{
"type": "featured_collection"
}
]
}
]
}
{% endschema %}