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? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, 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 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, 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: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. Content: Links in my posts may refer to SF Digital products or may be affiliate links. If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too. 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: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. Content: Links in my posts may refer to SF Digital products or may be affiliate links. If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too. 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