Hi all,
I am trying to customize my website homepage. Using the theme Dawn.
I have added the following code under section and called collectio-tabs.
What I wanted is to have the collection images on a slider and when selecting one collection the products of that collection to appear under them.
Everithing works fine after adding the tabs untilI save the changes (see picture below the code). After that the Collections pictures and the products picture are oriented vertically (see picture below the code).
{{ 'component-card.css' | asset_url | stylesheet_tag }}
{{ 'component-price.css' | asset_url | stylesheet_tag }}
{{ 'component-slider.css' | asset_url | stylesheet_tag }}
{{ 'template-collection.css' | asset_url | stylesheet_tag }}
{% if section.blocks.size > 0 %}
{% if section.settings.useslider %}
{% endif %}
{% if section.settings.title != blank %}
## {{ section.settings.title }}
{% endif %}
{% assign tabContent = '' %}
{% for block in section.blocks %}
{% assign collection = collections[block.settings.collection] %}
- {{ collection.title }}
{% capture content %}
{%- for product in block.settings.collection.products limit: 20 -%}
- {% render 'card-product',
card_product: product,
media_aspect_ratio: section.settings.image_ratio,
image_shape: section.settings.image_shape,
show_secondary_image: section.settings.show_secondary_image,
show_vendor: section.settings.show_vendor,
show_rating: section.settings.show_rating,
show_quick_add: section.settings.enable_quick_add,
section_id: section.id
%}
{%- endfor -%}
{% if block.settings.viewall %}
View all
{% endif %}
{% endcapture %}
{% assign tabContent = tabContent | append: content %}
{% endfor %}
{{ tabContent }}
{% endif %}
{% schema %}
{
"name": "Tabs",
"settings": [
{
"type": "text",
"id": "title",
"label": "Title"
},
{
"type": "checkbox",
"id": "useslider",
"label": "Use slider",
"default": true
}
],
"blocks": [
{
"type": "tab",
"name": "Tab",
"limit": 25,
"settings": [
{
"type": "collection",
"id": "collection",
"label": "Collection"
},
{
"type": "checkbox",
"id": "viewall",
"label": "Show view all",
"default": true
}
]
}
],
"presets": [
{
"name": "Tabs",
"blocks": []
}
]
}
{% endschema %}
Here it is how it shoul look. If I diseble and enable the “use slider” funtion it shows correctly.
After saving or if I refresh it looks like in the picture below.
I hope somone can help me with this!
Thanks in advance




