Jump to content

Gallery: External link in new window/tab?

Recommended Posts

I have an image in my gallery that i need to link to an external site. I need this to open in a new tab otherwise it will send customers off of my site, not ideal.

Squarespace have told me this is not a currently available feature (no idea why).

Does anyone know a way around this/way to inject code to help me out?

Link to comment
  • 4 weeks later...
  • Replies 38
  • Views 41.6k
  • Created
  • Last Reply
  • 5 weeks later...
  • 2 months later...
  • 1 month later...
  • 7 months later...
  • 3 months later...
  • 1 month later...
  • 1 month later...

When I try to use this style of link for an image in my gallery, it says it is an invalid link...I tried to upload a photo of the issue, but I'm too new.

So I put in my link precisely as instructed, but there's a red warning saying "please enter a valid URL."

Is there a reason for this? Please help : (

Link to comment
  • 4 weeks later...
  • 3 weeks later...

To add some clarification here, this is what you're doing:

To get a link to open in a new page, the proper HTML is:

<a href="http://answers.squarespace.com/questions/23324/gallery-external-link-in-new-windowtab" target="_blank">Link</a>

Squarespace doesn't offer the "Open in new window" checkbox in the gallery images like they do in the image block and other link fields. That checkbox simply adds the


code before the close bracket.

The hack for gallery links to open in a new window is to add the necessary code for it to open in a new window before the closing quotation marks, which is why you add this to the end of your URL (without closing quotes):


The first set of quotes are the closing quotes for the URL, and the original closing quotes that Squarespace provides become the closing quotes for the target="_blank".

Since Squarespace doesn't allow spaces in its URLs and gives you an error if you try to add it, you need to leave the space before target out.

Hope that helps!

Link to comment
  • 6 months later...
  • 3 weeks later...

To all of those who are getting an error. The reason is that in a few of the postings listed on this page, people have said to add the

http://yourlinkhere.com" target="_blank

in the URL box. The problem is that there is an extra space before the


area. Just get rid of that extra space and it should work just fine. So, in conclusion, the exact coding should be:


Hope this helps.

@nataliemumford @jasminerh @samfinding_alliants @Mixtus Media @AndersArrenius @mpcole73

Link to comment
  • 1 month later...


This topic is now archived and is closed to further replies.

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