【发布时间】:2018-06-19 07:20:46
【问题描述】:
如何检测 shopify if Homepage?以前有一个处理程序是page.frontpage,现在不再使用了。
我需要从主页中排除某些内容,因此无法编辑index.liquid 文件。
【问题讨论】:
如何检测 shopify if Homepage?以前有一个处理程序是page.frontpage,现在不再使用了。
我需要从主页中排除某些内容,因此无法编辑index.liquid 文件。
【问题讨论】:
我们可以这样做:
{% if template.name != "index" %}
do something
{% endif %}
【讨论】:
要检测主页,您应该使用双等号“==”,感叹号“!=”的使用是发现所有“不”等于“索引”。
{% if template.name == "index" %}
do something
{% endif %}
【讨论】:
我是这样使用的:
{% if template.name != "index" %}
do something
{% endif %}
【讨论】: