我想要一个 if 语句products.html
来检查您是否在类别页面上。例如 url 是site.com/category/hoodies
,我想为 Hoodies 类别显示一个“英雄”图像。
也许有一个类别页面的模板?
我想要一个 if 语句products.html
来检查您是否在类别页面上。例如 url 是site.com/category/hoodies
,我想为 Hoodies 类别显示一个“英雄”图像。
也许有一个类别页面的模板?
您可以访问多个页面变量,记录在这里:https ://help.bigcartel.com/developers/themes/#variables-1
page.full_url
在这种情况下可以解决问题:
{% if page.full_url contains '/category/hoodies' %}
<img src="http://website.com/image.jpg">
{% endif %}