お世話になります。
類似の質問はありましたが、解決まで辿り着けませんでしたのでご質問させていただきます。
テンプレート:Dawn
featured-collectionを流用しています。
やりたいこと:・・・・・
同一セクション内でタブごとに別のコレクションを配置
設置まではできたのですが、同じコレクションが表示されており、行き詰まっています。
タブごとにコレクションを分岐する方法はありますでしょうか?
{%- for block in section.blocks -%}
## {{ block.settings.title | escape }}
{%- if section.settings.show_view_all and section.settings.swipe_on_mobile and more_in_collection -%}
{{ 'sections.featured_collection.view_all' | t }}
{%- endif -%}
{%- if section.settings.show_view_all and more_in_collection -%}
{{ 'sections.featured_collection.view_all' | t }}
{%- endif -%}
## {{ block.settings.title | escape }}
{%- if section.settings.show_view_all and section.settings.swipe_on_mobile and more_in_collection -%}
{{ 'sections.featured_collection.view_all' | t }}
{%- endif -%}
{%- if section.settings.show_view_all and more_in_collection -%}
{{ 'sections.featured_collection.view_all' | t }}
{%- endif -%}
{% endfor %}
{% schema %}
{
"name": "テスト",
"max_blocks": 2,
"settings": [
{
"type": "range",
"id": "products_to_show",
"min": 2,
"max": 20,
"step": 2,
"default": 4,
"label": "t:sections.featured-collection.settings.products_to_show.label"
},
{
"type": "checkbox",
"id": "show_view_all",
"default": true,
"label": "t:sections.featured-collection.settings.show_view_all.label"
},
{
"type": "checkbox",
"id": "swipe_on_mobile",
"default": false,
"label": "t:sections.featured-collection.settings.swipe_on_mobile.label"
},
{
"type": "header",
"content": "t:sections.featured-collection.settings.header.content"
},
{
"type": "select",
"id": "image_ratio",
"options": [
{
"value": "adapt",
"label": "t:sections.featured-collection.settings.image_ratio.options__1.label"
},
{
"value": "portrait",
"label": "t:sections.featured-collection.settings.image_ratio.options__2.label"
},
{
"value": "square",
"label": "t:sections.featured-collection.settings.image_ratio.options__3.label"
}
],
"default": "adapt",
"label": "t:sections.featured-collection.settings.image_ratio.label"
},
{
"type": "checkbox",
"id": "show_secondary_image",
"default": false,
"label": "t:sections.featured-collection.settings.show_secondary_image.label"
},
{
"type": "checkbox",
"id": "add_image_padding",
"default": false,
"label": "t:sections.featured-collection.settings.add_image_padding.label"
},
{
"type": "checkbox",
"id": "show_image_outline",
"default": true,
"label": "t:sections.featured-collection.settings.show_image_outline.label"
},
{
"type": "checkbox",
"id": "show_vendor",
"default": false,
"label": "t:sections.featured-collection.settings.show_vendor.label"
},
{
"type": "checkbox",
"id": "show_rating",
"default": false,
"label": "t:sections.featured-collection.settings.show_rating.label",
"info": "t:sections.featured-collection.settings.show_rating.info"
}
],
"blocks": [
{
"type": "collection",
"name": "Season",
"settings": [
{
"type": "collection",
"id": "collection",
"label": "t:sections.collection-list.blocks.featured_collection.settings.collection.label"
}
]
}
],
"presets": [
{
"name": "Collection tabs",
"category": "Season",
"blocks": [
{
"type": "collection"
},
{
"type": "collection"
}
]
}
]
}
{% endschema %}