Change HEADER on some pages

Highlighted
New Member
1 0 0

Hello, I'm trying to make my header change when i'm on a certain page.

So my idea is to put a if-else statement on the theme.liquid file to know on which page i am on and put the header i want (this part is ok).

image.png

 

but when i'm creating the section header2 I cant modify the default value of the header.

image.png

image.png

So i can't create the 2nd header. Is there any way to modify this line or to change the value in any way ?

Thanks for your help, if you have any proposition by doing it this way or an other way, its will be very cool!

 

0 Likes
Highlighted
Shopify Partner
2294 117 353

The template , request objects can be use to figure out the current location

https://shopify.dev/docs/themes/liquid/reference/objects/template

https://shopify.dev/docs/themes/liquid/reference/objects/request

 

{% if template == 'collection %}

{% endif %}

but when i'm creating the section header2 I cant modify the default value of the header.

You have to make sure there are no typos from when you made that file.

Other than that there is not enough information for others to aid you.

 

 

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes