Jump to content

Warning / Disclaimer for Link on site

Go to solution Solved by paul2009,

Recommended Posts

Posted

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?

  • 9 months later...
  • 2 months later...
Posted (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 by creedon

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.

Posted
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.

Posted
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?

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
Posted (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:

image.png.ff0e50e000023d63ac0675852e18aa7f.png

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:

image.thumb.png.219e3e17e118b6ef9607ced049cb5ce5.png

Did this help? Please give feedback by clicking an icon below  ⬇️

Edited by paul2009
Sqsp moved the Code Injection panel again!

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
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.

  • 1 month later...
Posted

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? 

Posted
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.

Posted
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.

  • 10 months later...
Posted

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? 

Posted
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!

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.