我有一个问题。如何在“博客”页面中导入该集合?
{%- assign collection = collections[section.settings.collection] -%}
{% for product in collection.products limit: product_limit %}
<div class="grid__item {{ grid_item_width }}">
{% include 'product-card-grid', grid_image_width: image_size %}
</div>
{% endfor %}
我已尝试过上面的代码,但它不起作用。我想要展示产品 https://www.luxilash.com/collections/3dminklashes
答案 0 :(得分:0)
好吧,我猜你没有为
设置配置section.settings.collection
在页面模板中。您确定section.settings.collection
具有适合您案例的价值吗?
为方便起见,请尝试使用以下代码快照:
{%- assign collection = collections['3dminklashes'] -%}
{% for product in collection.products limit: product_limit %}
<div class="grid__item {{ grid_item_width }}">
{% include 'product-card-grid', grid_image_width: image_size %}
</div>
{% endfor %}
我只是从您提供的网址中抓取了收集代码。
https://www.luxilash.com/collections/3dminklashes