Header Headaches

Hello,

First of all, I hope I’m in the right place if not maybe someone can point me in the direction I need to go!

On my Wix site, I want the header and footer to be visible and locked on all pages. This part is working just fine. What I need to be able to change are certain elements on the header that will show or hide based on the page.

For example when entering my site on the top right of the header I have a button that allows the user to enter the site and access the content I have. Once on this page instead of having the button to allow the user to log in, I need a button to allow access to my online store.

I’ve tried everything I can think of to get this to work, but of course anything changed on the header effect the header for all pages.

My first thought on how to get this done would be to right-click the button and slide the “show on all pages” off, but this doesn’t seem to be an option as it is ghosted out and will not allow me to change it.

Does anyone have any ideas on how can get this to work? Thanks so much in advance!!

Inside masterpage.js, check the current page: https://www.wix.com/velo/reference/wix-site/currentpage

Then change the button label and its source depending on the page:
https://www.wix.com/velo/reference/$w/button/label
https://www.wix.com/velo/reference/$w/button/link

I hope this helps :slight_smile:

Hi Joel and thanks so much for responding!

Once upon a time, I was pretty good at figuring this stuff out, but sadly I’m drawing a blank on how to implement what you suggested. Thankfully I just need this one button to swap and I’ll be able to move on to another task - will for sure be glad to put this one behind me.

So I entered Dev mode and found masterPage.js - But I’m not sure where or what to enter to check the current page. My masterPage.js seems to be empty as this is all it contains:

// The code in this file will load on every page of your site

$w.onReady( function () {
// Write your code here
});

I was wondering if you might be willing to provide me with an example as to how this should look. The name of the page should be Home.

Thanks so much!