I want to make a section where I can add 3 images. Each image will be styled differently so must be wrapped in it's own classes and elements.
I've been able to do the 3 images by using a for loop eg:
{% for block in section.blocks %}
<div class="image_box">
{{ block.settings.image | img_url: '150x150', scale: 2 | img_tag: block.settings.image.alt, 'logo-bar__image' }}
</div>
{% endfor %}
But, of course, this just means each image block is identical.
How can I display and style each image block uniquely?
My schema is as such:
{% schema %}
{
"name": {
"en": "Multi-hero"
},
"class": "index-section index-section--flush",
"max_blocks": 3,
"settings": [
],
"blocks": [
{
"type": "image",
"name": {
"en": "Image"
},
"settings": [
{
"type": "image_picker",
"id": "image",
"label": {
"en": "Image"
}
}
]
}
],
"presets": [
{
"name": {
"en": "Multi-hero"
},
"category": {
"en": "Image"
},
"blocks": [
{
"type": "image"
},
{
"type": "image"
},
{
"type": "image"
}
]
}
]
}
{% endschema %}