Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
Cirqster

Gallery: External link in new window/tab?

Question

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?

Edited by Cirqster
Tidy

Share this post


Link to post

Recommended Posts

  • 5

When you add a link to the image, put in the following:

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

it works the same for files, example:

/s/01.jpg"target="_blank

I hope that helps!

Essentially you'll add "target="_blank to the end of your URL with no space in-between.

Edited by TreyT

designer

Share this post


Link to post
  • 7

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

target="_blank"

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):


"target="_blank

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!

Edited by Mixtus Media

Share this post


Link to post
  • 6

You need to add the target attribute into your anchor link


<a href="http://www.google.com" target="_blank"> link text </a>



Edited by SquareDeb

Share this post


Link to post
  • 5

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

target="_blank

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

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

Hope this helps.

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

Edited by Fubeman
Initial Revision

Share this post


Link to post
  • 1

This will work fine, you just can't add a space into the url section, so just add this to the end of the Clickthrough URL (no spaces)

"target="_blank

Edited by jeepsburg
Initial Revision

Share this post


Link to post
  • 0

Thanks Jasminerh! It works like a charm!

samfinding_alliants, the solution works but not instantly, you’ll have to wait some minutes to take effect.

Edited by ABaeta

Share this post


Link to post
  • 0

@SOIN, is that a delay in the window or tab opening? Could you post a link to a page that shows this?


The name is an Anglicised form of the Greek Korvetti — I like to think there’s a little bit of the ancient Hellenic drive in me.

Share this post


Link to post
  • 0

neither btw - it was after saving the link, to open externally, it did not take affect at first. Seemed to take 5-10 min then worked - did not seem like a cache issue- but that was in march.

Share this post


Link to post
  • 0

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

Share this post


Link to post
  • 0

Is anyone able to help me as mine is not working? I am trying to get a file to open in a new window from a gallery.

I have done -

/s/"H&BBrochure.pdf" target="blank"

Any ideas why it is taking me to an unknown error page? @jasminerh @samfinding_alliants @Mixtus Media @AndersArrenius

Thanks

Share this post


Link to post
  • 0

Hi @nataliemumford,

Not sure if you have got the solution. I think this is due to the blank in your URL. You should use /s/H&BBrochure.pdf"target="blank.

Let me know?

Regards,Melvin

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...