JamesMoruzzi Posted February 9, 2022 Share Posted February 9, 2022 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 Link to comment
Beyondspace Posted February 9, 2022 Share Posted February 9, 2022 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? Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
JamesMoruzzi Posted February 9, 2022 Author Share Posted February 9, 2022 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..! Link to comment
JamesMoruzzi Posted February 9, 2022 Author Share Posted February 9, 2022 @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..! Link to comment
Beyondspace Posted February 10, 2022 Share Posted February 10, 2022 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 JamesMoruzzi 1 Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
JamesMoruzzi Posted February 11, 2022 Author Share Posted February 11, 2022 @bangank36 Thank you so much! I added it to the Footer section in code injection and it works. I have been searching everywhere and you saved me 🙏🙏🙏🙏 Beyondspace 1 Link to comment
Red_Dot_Design Posted July 20, 2022 Share Posted July 20, 2022 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? Link to comment
Red_Dot_Design Posted July 20, 2022 Share Posted July 20, 2022 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 Link to comment
paul2009 Posted July 20, 2022 Share Posted July 20, 2022 (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 🙂 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 July 20, 2022 by paul2009 edited for clarity Red_Dot_Design and IsaWP 2 About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. Content: Links in my posts may refer to SF Digital products or may be affiliate links. Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.Improve your online store with our extensions. Link to comment
Red_Dot_Design Posted July 21, 2022 Share Posted July 21, 2022 Hi Paul, thanks so much for this! In that case it looks like I need to add an age gate separately. Would you be able to advise how to do this or do you know of any relevant plugins? Link to comment
paul2009 Posted July 21, 2022 Share Posted July 21, 2022 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. About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. Content: Links in my posts may refer to SF Digital products or may be affiliate links. Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.Improve your online store with our extensions. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment