Jump to content

Warning / Disclaimer for Link on site

Go to solution Solved by paul2009,

Recommended Posts

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?

Link to comment
  • 9 months later...
  • 2 months later...

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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
  • Solution
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 Settings > Developer Tools > Code Injection > Footer

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

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
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.

Link to comment
  • 1 month later...
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  ⬇️

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
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 🙂

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment

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.