skip to Main Content

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.

3

Answers


  1. Chosen as BEST ANSWER

    Here is how we can do that:

    {% if template.name != "index" %} 
     do something
    {% endif %}
    

  2. I use it in this way:

        {% if template.name != "index" %}
          do something
        {% endif %}
    
    Login or Signup to reply.
  3. 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 %}
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search