Shopify使用特定模板获取所有收藏

Shopify使用特定模板获取所有收藏,shopify,liquid,Shopify,Liquid,我正在尝试在shopify中创建一个品牌页面。为此,我有一个自定义页面模板page.brands和一个自定义模板collection.brands 现在,我需要遍历所有集合,并使用自定义模板仅查找那些集合 {% for collection in collections %} {{ template }} // template here returns 'page.brands' not 'collection.brands' {% endfor %} 找到了一些按名称搜索的解决方案

我正在尝试在shopify中创建一个品牌页面。为此,我有一个自定义页面模板
page.brands
和一个自定义模板
collection.brands

现在,我需要遍历所有集合,并使用自定义模板仅查找那些集合

{% for collection in collections %}

  {{ template }} // template here returns 'page.brands' not 'collection.brands'

{% endfor %}
找到了一些按名称搜索的解决方案,但如果我要添加更多集合,我还必须向数组中添加名称

有什么帮助吗?有什么办法吗?

在中找到了答案

{% for collection in collections %}
        
  {% if collection.template_suffix == "brands" %}
        
        {{ collection.title }} 
        
  {% endif %}
        
{% endfor %}