Hey, guys! New to Shopify and Liquid here. I’m trying to build a new theme and just want to ask what’s the best way of designing a schema for slider with images, texts, and links. Basically per slide it will have an Image, a text, and a link.
I have this code
{% assign image_blocks = section.blocks | where: 'type', 'category_image' %}
{% assign title_blocks = section.blocks | where: 'type', 'category_title' %}
{% for block in image_blocks %}
{% endfor %}
{% for block in title_blocks %}
### {{ block.settings.category_title }}
{% endfor %}
which outputs the images and texts like this..
What I would like is an output like this using my schema(down below) I have. Is my design for this schema correct or best practice?
## {{ the_title }}
## {{ the_title }}
## {{ the_title }}
My schema
{% schema %}
{
"name":"Categories",
"tag":"section",
"class":"categories",
"blocks":[
{
"name":"Category Image",
"type":"category_image",
"settings":[
{
"type":"image_picker",
"id":"image",
"label":"Image"
}
]
},
{
"name":"Category Title",
"type":"category_title",
"settings":[
{
"type":"text",
"id":"category_title",
"label":"Category Title"
}
]
},
{
"name":"Category Link",
"type":"category_link",
"settings":[
{
"type":"url",
"id":"category_link",
"label":"Category Link"
}
]
}
]
}
{% endschema %}