Shopify(液体)如果产品有标签,则回显该标签

Shopify(液体)如果产品有标签,则回显该标签,shopify,liquid,Shopify,Liquid,我试图找到符合条件的产品标签,然后显示这些标签 这会给我一个产品的所有标签 {% for tag in product.tags %} {% if product.tags contains '336699' %} {{ tag }} {% endif %} {% endfor %} 我怎样才能回显满足“包含”条件的标记?您就快到了。用于迭代product.tags,并在a内将tag与字符串文字条件匹配 {% for tag in product.tags %} {% if tag c

我试图找到符合条件的产品标签,然后显示这些标签

这会给我一个产品的所有标签

{% for tag in product.tags %}
{% if product.tags contains '336699' %}
{{ tag }}
{% endif %}
{% endfor %}
我怎样才能回显满足“包含”条件的标记?

您就快到了。用于迭代
product.tags
,并在a内将
tag
与字符串文字条件匹配

{% for tag in product.tags %}
    {% if tag contains '336699' %}
        {{ tag }}
    {% endif %}
{% endfor %}
你快到了。用于迭代
product.tags
,并在a内将
tag
与字符串文字条件匹配

{% for tag in product.tags %}
    {% if tag contains '336699' %}
        {{ tag }}
    {% endif %}
{% endfor %}

谢谢你的快速回答!谢谢你的快速回答!