I want to have a different styled header on my index page and already created it. I just duplicated the header.liquid and the header-group.json and made a header-index.liquid and a header-group-index.json
Now I thought I could just use a simple if statement in the theme.liquid where the header-group is loaded into the theme. I attached a screenshot of how I imagened it. It is just that I don’t know how to target the index page. It obviouly does not work with page.name == index… Does anyone now how this if statement would work or has a different solution?
hi @pajurama
Its SideNode! We will be happy to help you today.
You can try this code: it will be helpful to you
{% if template == 'index' %}
“If you modify the provided if condition as suggested, it will work correctly.”
If I was able to assist you, please remember to give it a Like and Mark it as the Solution!
Let me know if need further assistance
Regards,
SideNode
Hello SideNode
Thank you so much for taking time and looking at my issue. So, it actually works! But there is a big but. I attached screenshots for you to take a look. As soon as I change that line of code {% sections ‘header-group’ %} everything breaks. I also tested it this morning. As soon as I change or remove that line of code the thing that you can see in the screenshot happens that the product grids are doing that weird stuff and the most annoying thing about it is that I can’t make it undone. When I put that line of code back and save the issue is not resolved. This morning I had to start a new dawn theme and copy all my custom coding from the broken one to the new one…Does anyone know why that happens and how to fix it? One Image shows how it is before and the other one after I change that line of code.
Also all the images are gone and it also applies to the featured product sections and probably. Just the main product page where only one product is visible still looks good.