shopify Liquid error: Memory limits exceeded
shopify Liquid error: Memory limits exceeded
我试图在一个页面中显示我网站的所有产品类型,2 天前它列出了所有产品类型。
但现在当该页面加载时,它给出错误 "shopify Liquid error: Memory limits exceeded"
这是我的代码
<div class="rte">
{{ page.content }}
<ul class="vendor-list block-grid three-up mobile one-up">
{% for product_type in shop.types %}
{% assign its_a_match = false %}
{% capture my_collection_handle %} {{ type | handleize | strip | escape }} {% endcapture %}
{% assign my_collection_handle_stripped = my_collection_handle | strip | escape %}
{% for collection in collections %}
{% if my_collection_handle_stripped == collection.handle %}
{% assign its_a_match = true %}
{% endif %}
{% endfor %}
{% if its_a_match %}
<li class="vendor-list-item"><a href="/collections/{{ product_type | handleize }}">{{ product_type }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
我该如何克服这个问题?
尝试以下操作。速度更快,效率更高。
<div class="rte">
{{ page.content }}
<ul class="vendor-list block-grid three-up mobile one-up">
{% for product_type in shop.types %}
{% assign type = product_type | strip | escape | handleize %}
{% assign collection = collections[type] %}
{% if collection.handle != '' %}
<li class="vendor-list-item"><a href="/collections/{{ collection.handle }}">{{ product_type }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
我试图在一个页面中显示我网站的所有产品类型,2 天前它列出了所有产品类型。
但现在当该页面加载时,它给出错误 "shopify Liquid error: Memory limits exceeded"
这是我的代码
<div class="rte">
{{ page.content }}
<ul class="vendor-list block-grid three-up mobile one-up">
{% for product_type in shop.types %}
{% assign its_a_match = false %}
{% capture my_collection_handle %} {{ type | handleize | strip | escape }} {% endcapture %}
{% assign my_collection_handle_stripped = my_collection_handle | strip | escape %}
{% for collection in collections %}
{% if my_collection_handle_stripped == collection.handle %}
{% assign its_a_match = true %}
{% endif %}
{% endfor %}
{% if its_a_match %}
<li class="vendor-list-item"><a href="/collections/{{ product_type | handleize }}">{{ product_type }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
我该如何克服这个问题?
尝试以下操作。速度更快,效率更高。
<div class="rte">
{{ page.content }}
<ul class="vendor-list block-grid three-up mobile one-up">
{% for product_type in shop.types %}
{% assign type = product_type | strip | escape | handleize %}
{% assign collection = collections[type] %}
{% if collection.handle != '' %}
<li class="vendor-list-item"><a href="/collections/{{ collection.handle }}">{{ product_type }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>