JamesMoruzzi Posted February 9, 2022 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
Beyondspace Posted February 9, 2022 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? 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
JamesMoruzzi Posted February 9, 2022 Author 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..!
JamesMoruzzi Posted February 9, 2022 Author 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..!
Beyondspace Posted February 10, 2022 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 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
JamesMoruzzi Posted February 11, 2022 Author 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
Red_Dot_Design Posted July 20, 2022 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?
Red_Dot_Design Posted July 20, 2022 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
paul2009 Posted July 20, 2022 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 IsaWP and Red_Dot_Design 2 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.
Red_Dot_Design Posted July 21, 2022 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?
paul2009 Posted July 21, 2022 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. 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment