液体错误:超过集合的最大唯一句柄数。(Shopify)

液体错误:超过集合的最大唯一句柄数。(Shopify),shopify,liquid,shopify-template,Shopify,Liquid,Shopify Template,是什么原因导致这个错误出现在一个Shopify网站上,而这个网站已经很长时间没有主题或应用程序更改了 液体错误:超过集合的最大唯一句柄数 我收藏太多了 collections数组似乎只允许循环遍历前1000个项目,或者使用{%assign filter\u collection=collections[handle]]}等语法获取1000个项目。(谢谢@drip) 错误消息在我调用{%assign filter\u collection=collections[handle]]}的第1000次时

是什么原因导致这个错误出现在一个Shopify网站上,而这个网站已经很长时间没有主题或应用程序更改了

液体错误:超过集合的最大唯一句柄数


我收藏太多了

collections
数组似乎只允许循环遍历前1000个项目,或者使用
{%assign filter\u collection=collections[handle]]}
等语法获取1000个项目。(谢谢@drip)

错误消息在我调用
{%assign filter\u collection=collections[handle]]}
的第1000次时输出

我在官方文档中找不到这方面的参考,但1000次迭代的限制可以这样证明:

    shop.collections_count: {{ shop.collections_count }}
    collections.length:     {{ collections.length }}
    collections | size:     {{ collections | size }}
    
    {%- assign i = 0 -%}
    {%- for col in collections -%}
        {%- assign i = i | plus:1 -%}
        {%- if i > 995 -%}
            {{ i }}
        {%- endif -%}
    {%- endfor -%}
产出:

shop.collections_count: 1814
collections.length:     1814
collections | size:     1814
996
997
998
999
1000

您是否在某个for循环中有
集合[句柄]
?我还没有经历过这种情况,但似乎所有产品的[handle]限制为20次调用,因此对集合也有限制。我有类似的东西,是的。这篇文章应该对你们的问题有所帮助。我猜Shopify之前没有执行这个限制,或者你的商店挤满了裂缝。