[英]How to show current tags filter in Shopify only if the current tags are more than 1
我需要幫助,僅當當前標簽超過 1時才顯示標簽過濾器,目前我的過濾器即使在單個標簽的情況下也會顯示。 我嘗試了以下但找不到確切的液體語法:
<dd>
<ol>
{% for t in tags %}
{% assign tag = t | strip %}
{% assign tag_value = tag | handleize %}
{% if current_tags contains tag %}
{% if current_tags > 1 %}
<li>
<input type="checkbox" value="{{ tag_value }}" checked/>
<label>{{ tag }}</label>
</li>
{% else %}
{% if collection.tags contains tag %}
<li>
<input type="checkbox" value="{{ tag_value }}"/>
<label>{{ tag }}</label>
</li>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</ol>
</dd>
提前致謝
如果條件檢查當前標簽大於 1,您可以使用它
{% if current_tags.size > 1 %}
{% endif %}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.