Reputation: 2173
How do I detect shopify if Homepage
? Previously there was a handler which was page.frontpage
which is not used anymore.
I need to exclude something from the homepage, so I can't go for editing the index.liquid
file.
Upvotes: 9
Views: 30215
Reputation: 81
To detect the homepage you should use double equals "==" the use of the exclamation "!=" is finding everything "not" equal to "index".
{% if template.name == "index" %}
do something
{% endif %}
Upvotes: 8
Reputation: 2173
Here is how we can do that:
{% if template.name != "index" %}
do something
{% endif %}
Upvotes: 33
Reputation: 133
I use it in this way:
{% if template.name != "index" %}
do something
{% endif %}
Upvotes: 0