如何检测shopify if Homepage?以前有一个page.frontpage不再使用的处理程序。
我需要从首页中排除某些内容,因此无法进行index.liquid文件编辑。
MD.*_*man 10
这是我们可以做到的:
{% if template.name != "index" %}
do something
{% endif %}
Run Code Online (Sandbox Code Playgroud)
小智 5
要检测主页,您应该使用双等号“==”,感叹号“!=”的使用是找到“不”等于“索引”的所有内容。
{% if template.name == "index" %}
do something
{% endif %}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2180 次 |
| 最近记录: |