Jump to content

How to Change Logo Link in Top Navigation (Theme: Nolan)

Recommended Posts

Posted

Site URL: https://www.nothingisnotnothing.com/

I have created a cover page for my website:

https://www.nothingisnotnothing.com/

To do this I created a home page and removed the header and footer etc.

The cover page links through to the main site: 
https://www.nothingisnotnothing.com/home

However, when you click the logo on the main site it links back to the cover page - because it is set as the homepage.

I want the logo / site title in the top navigation to link back to the main site rather than the cover page.

Is there a code I can use to do this?

Thanks,

James

Posted
1 hour ago, JamesMoruzzi said:

Site URL: https://www.nothingisnotnothing.com/

I have created a cover page for my website:

https://www.nothingisnotnothing.com/

To do this I created a home page and removed the header and footer etc.

The cover page links through to the main site: 
https://www.nothingisnotnothing.com/home

However, when you click the logo on the main site it links back to the cover page - because it is set as the homepage.

I want the logo / site title in the top navigation to link back to the main site rather than the cover page.

Is there a code I can use to do this?

Thanks,

James

What is the url slug of the cover page?

image.thumb.png.517942217bc4f8e788e9b411d79d31ca.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> No-code customisations for Squarespace

Posted

@bangank36

This is the cover page URL:
https://www.nothingisnotnothing.com/hello

The cover page will also load with this as it's set to homepage https://www.nothingisnotnothing.com/

Note:

I moved the domain over to this site yesterday, so you might see incorrect visuals for the next 48 hours. The cover page has a big logo on a dark blue back ground. Thought you might get confused by what you were seeing..!

Posted

Try adding to Home > Settings > Advanced > Code Injection

<script>
    (function() {
        window.addEventListener('DOMContentLoaded', () => {
          document.querySelector('.header-title-logo > a').setAttribute('href', '/home');
        });
    })()
</script>

Let me know how it works on your site

Support me by pressing 👍 if this useful for you

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> No-code customisations for Squarespace

  • 5 months later...
Posted

Hey, this code:

<script>
    (function() {
        window.addEventListener('DOMContentLoaded', () => {
          document.querySelector('.header-title-logo > a').setAttribute('href', '/home');
        });
    })()
</script>

worked for me on desktop but when I test it on mobile it still links back to the cover page, is there a fix for this? 

Posted

Site URL: https://halibut-porcupine-m9fs.squarespace.com/

Site URL: https://halibut-porcupine-m9fs.squarespace.com/

Password: halibut

I have created a cover page for my website which I've set as the homepage. 

To do this I created a home page and removed the header and footer etc.

The cover page links through to the main site: 

https://halibut-porcupine-m9fs.squarespace.com/home

Originally when you click the logo on the main site it links back to the cover page - because it is set as the homepage.

This bit of code has solved this on the desktop site but not on mobile. Can anyone help me change it on mobile as well?

<script>
    (function() {
        window.addEventListener('DOMContentLoaded', () => {
          document.querySelector('.header-title-logo > a').setAttribute('href', '/home');
        });
    })()
</script>

Thanks,

Tara

Posted (edited)
31 minutes ago, Red_Dot_Design said:

I have created a cover page for my website which I've set as the homepage. Originally when you click the logo on the main site it links back to the cover page - because it is set as the homepage.

Code has solved this on the desktop site but not on mobile. Can anyone help me change it on mobile as well?

@Red_Dot_Design Before I answer your specific question, I feel it only right to explain that your content warning on the homepage may not be seen by visitors to the site.

This is because, once the site is live, users may arrive on the website from search results that take them to other pages on the site (like this link), bypassing the homepage completely.

I just wanted to let you know in case you weren't aware 🙂

image.thumb.png.6c7839ea60e33a2be0659f62f21dae69.png

To answer your question, the desktop and mobile versions of the site have separate site logos with separate settings. The code that you've reposted identifies the first one (desktop) and skips the second one (mobile). To change the link on the mobile version of the logo, you'll also need to add this:

document.querySelector('.header-display-mobile .header-title .header-title-logo > a').setAttribute('href', '/home');

Add it after the first version so that it looks something like this:

<script>
  (function() { 
    window.addEventListener('DOMContentLoaded', () => { 
      document.querySelector('.header-title-logo > a').setAttribute('href', '/home');
      document.querySelector('.header-display-mobile .header-title .header-title-logo > a').setAttribute('href', '/home');      
    });
  })() 
</script>

 

Edited by paul2009
edited for clarity

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Posted
10 minutes ago, Red_Dot_Design said:

Would you be able to advise how to do this or do you know of any relevant [age gate] plugins? 

We built an Age Verification extension specifically for Squarespace. Feel free to DM me if you have questions.

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.