Shopify - 在我的首页上加载 'collections/all' 页面

Shopify - Load 'collections/all' page on my front page

如何加载 http://example.myshopify.com/collections/all 内容 到我的 shopify 主页 http://example.myshopify.com/

我想出了一种在 index.liquid 上硬编码 <script>window.location.href='collections/all'</script> 的方法,但我很确定那不是一个干净的方法。

我尝试将整个 collection.liquid 的代码复制到 index.liquid,但它提示我 Liquid error: Array 'collection.all.products' is not paginateable. 错误并且没有产品显示 index.liquid 页面。

知道如何在 shopify 的首页加载 collections/all 吗?

我正在使用 Timber Framework,因为人们建议开始构建主题

里面

你包括这个:

{% for product in collections.all.products %}
    // here you have access to each product
{% endfor %}

这将循环播放您的所有产品。

您可以查看 http://cheat.markdunkley.com/ 您可以在该循环中访问哪些产品变量。

在 Timber 框架中,您可以在 index.liquid 中更改此行:

{% for product in collections.frontpage.products limit:4 %}

至:

{% for product in collections.all.products %}

根据您拥有的产品数量,您可能仍希望limit how many are displayed, or paginate输出。

例如

{% paginate collections.all.products by 12 %}
{% for product in collections.all.products %}
...
{% endfor %}
{{ paginate | default_pagination }}
{% endpaginate %}