【发布时间】:2021-04-22 06:59:51
【问题描述】:
我正在尝试在 shopify 中创建品牌页面。为此,我有一个自定义页面模板 page.brands 和一个自定义模板 collection.brands。
现在我需要遍历所有集合并仅找到使用我的自定义模板的集合。
{% for collection in collections %}
{{ template }} // template here returns 'page.brands' not 'collection.brands'
{% endfor %}
找到了一些按名称搜索的解决方案,但如果我要添加更多集合,我还必须将名称添加到数组中。
对此有任何帮助或有什么方法吗?
【问题讨论】: