Givnish Posted June 9, 2022 Posted June 9, 2022 We are adding a link to an external site. We want to display a message stating that you are leaving our site. I know this isn't supported by Squarespace and I would have to write some code. Can anyone point me in the correct direction?
tuanphan Posted June 11, 2022 Posted June 11, 2022 Hi. What is your site url? We can check easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
sabcarluen Posted March 21, 2023 Posted March 21, 2023 Has this been resolved? I have the same question... Thank you!
tuanphan Posted March 25, 2023 Posted March 25, 2023 On 3/21/2023 at 12:43 PM, sabcarluen said: Has this been resolved? I have the same question... Thank you! If you share link to your site, we can help easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
andreabalogun_ Posted June 21, 2023 Posted June 21, 2023 I have a question about this too. I have a client that needs disclaimer pop-ups for links that leave the website. URL: https://newmoneynewproblems.squarespace.com/home Password: NMNP
creedon Posted June 22, 2023 Posted June 22, 2023 (edited) I don't have a solution but I'm curious why the need to put a disclaimer on every outgoing link? Is this kind of like a disclaimer that we are not responsible for the content on other sites? Could this be handled with a one time disclaimer of some kind? Or even a terms page? I think in 2023 most folks are aware that the content of links to other sites are not the responsibility of the site that you came from to get there. The only issue I could see to linking to other sites is if it involved some kind of legally actionable material. Edited June 22, 2023 by creedon paul2009 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
andreabalogun_ Posted June 23, 2023 Posted June 23, 2023 18 hours ago, creedon said: I don't have a solution but I'm curious why the need to put a disclaimer on every outgoing link? Is this kind of like a disclaimer that we are not responsible for the content on other sites? Could this be handled with a one time disclaimer of some kind? Or even a terms page? I think in 2023 most folks are aware that the content of links to other sites are not the responsibility of the site that you came from to get there. The only issue I could see to linking to other sites is if it involved some kind of legally actionable material. This is the first time I'm seeing this come up, but my client needs a website that is heavily monitored and needs to fall within some sort of compliance rules as a financial agency.
creedon Posted June 23, 2023 Posted June 23, 2023 1 hour ago, andreabalogun_ said: but my client needs a website that is heavily monitored and needs to fall within some sort of compliance rules as a financial agency. Understood. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
creedon Posted June 23, 2023 Posted June 23, 2023 On 6/21/2023 at 8:24 AM, andreabalogun_ said: I have a client that needs disclaimer pop-ups for links that leave the website. As I say I don't have a solution but how do you see this working? User clicks on an external link. A pop-up occurs with a message. How does the user flow from there? Is it like a two button alert were one button is proceed to the external link and other is cancel? Or, perhaps one button that just says OK? paul2009 and andreabalogun_ 2 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Solution paul2009 Posted June 23, 2023 Solution Posted June 23, 2023 (edited) On 6/21/2023 at 4:24 PM, andreabalogun_ said: I have a client that needs disclaimer pop-ups for links that leave the website. If the site will be on a Business Plan or above, here's something to get you started. Add it to Code Injection > Footer. This guide explains where to find this setting (Squarespace keep changing the navigation settings!). <!--- Inform user before allowing them to leave the site accidentally ----> <script> Array.from(document.querySelectorAll("a")).filter(l => l.hostname !== location.hostname).forEach(el => el.addEventListener("click", clickExt)); function clickExt(e) { if (confirm("You're about to leave our website. Do you want to continue?")) { return; } else { e.preventDefault(); return false; } } </script> This is very basic but it will should get you started by launching a basic browser popup whenever an external link is clicked. This will give visitors the opportunity to change their mind before leaving the site: With some additional HTML/JS, this could be improved by replacing the built-in browser popup with a custom one that includes the features that you need, for example: Did this help? Please give feedback by clicking an icon below ⬇️ Edited June 28 by paul2009 Sqsp moved the Code Injection panel again! andreabalogun_, creedon and gingershermanllc 2 1 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.
andreabalogun_ Posted June 27, 2023 Posted June 27, 2023 Thank you SOOOOOOOO MUCH!!!! This worked very well! Thank you. Thank you. paul2009 1
andreabalogun_ Posted June 27, 2023 Posted June 27, 2023 On 6/22/2023 at 8:39 PM, creedon said: As I say I don't have a solution but how do you see this working? User clicks on an external link. A pop-up occurs with a message. How does the user flow from there? Is it like a two button alert were one button is proceed to the external link and other is cancel? Or, perhaps one button that just says OK? A pop-up message. I think the solution below will work very well.
hannahstromvig Posted July 28, 2023 Posted July 28, 2023 When I click a button link on a site I'm building, it needs to pop up a message that displays ' you are now leaving this site and going to xyz'. Does anyone know how to do this or have a code to put in?
paul2009 Posted July 28, 2023 Posted July 28, 2023 1 hour ago, hannahstromvig said: When I click a button link on a site I'm building, it needs to pop up a message that displays ' you are now leaving this site and going to xyz'. Please see the answer I provided above. Did this help? Please give feedback by clicking an icon below ⬇️ 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.
hannahstromvig Posted August 4, 2023 Posted August 4, 2023 Is there a way to attach this to specific links? Some of the external links can be excluded from compliance.
paul2009 Posted August 4, 2023 Posted August 4, 2023 3 minutes ago, hannahstromvig said: Is there a way to attach this to specific links? Yes sure. You'll need to decide how you want to identify those (either the ones to be included or excluded) and then modify the selector to match/exclude them 🙂 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.
STutton Posted June 28 Posted June 28 Hi I've just tried the solution above but when clicking into Developer Tools the option of Code Injection doesn't appear. Can you help with this please?
paul2009 Posted June 28 Posted June 28 24 minutes ago, STutton said: clicking into Developer Tools the option of Code Injection doesn't appear. Can you help with this please? This guide explains where to find this setting. Squarespace keep moving the navigation options around! gingershermanllc 1 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