0

我想要一个 if 语句products.html来检查您是否在类别页面上。例如 url 是site.com/category/hoodies,我想为 Hoodies 类别显示一个“英雄”图像。

也许有一个类别页面的模板?

4

1 回答 1

0

您可以访问多个页面变量,记录在这里: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 %}
于 2016-03-04T20:13:07.747 回答