如果不是主页,请Shopify?

MD.*_*man 3 liquid shopify

如何检测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)