如何在Shopify中编辑页面上用于收集标签的内容 [英] How to edit content on pages for Collection Tags in Shopify

查看:458
本文介绍了如何在Shopify中编辑页面上用于收集标签的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Shopify中创建收藏集时,我可以轻松地向其添加标签,然后将其显示在收藏集"页面上(到目前为止,我已经使用了大多数主题). 收藏集"页面通常会显示该收藏集中任何产品的所有标签.

When creating Collections in Shopify I can easily add Tags to them, which are then displayed on the Collections pages (in most of the themes I've used so far). The Collections page will typically show all the Tags for any Product within that Collection.

如果单击标签,它将进入一个新页面.我正在尝试找到一种编辑这些页面的方法-Shopify似乎没有内置此功能,因此我正在寻找最佳解决方案.

If you click the Tag it will go to a new page. I'm trying to find a way to edit those pages - it does not appear that this ability is built into Shopify, so I'm looking for the best solution.

此网站上也很容易有一百多个标签.我希望避免编写大量条件语句,但我担心这可能是我唯一的选择.

There are easily over a hundred tags on this site too. My hope is to avoid writing a ton of conditional statements, but I fear that may be my only option.

液体-我在想什么的例子:

{% if current_tags == 'tag-name' %}
  unique content for that tag
{% endif %}

有人可以指出我的方向吗?

Can anyone point me in a better direction?

推荐答案

解决方案比我想象的要简单.我本应该使用'contains'时使用的是==.并不是说,如果您的标签使用空格,那么您应该将它们键入完全相同,而不是添加破折号来填充空格.

The solution was simpler than I thought. I was using == when I should have been using 'contains'. Not that if your tags use spaces then you should type them exactly the same vs adding dashes to fill spaces.

示例:

{% if current_tags contains 'My Tag' %}
  <!-- Custom HTML goes here -->
{% endif %}

这篇关于如何在Shopify中编辑页面上用于收集标签的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆