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

Gallery: External link in new window/tab?



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

Recommended Posts

  • 0

I'm having a related issue using a link to a PDF in the Gallery page.

I have added the code above, as suggested, to the end of the pdf title. But the added code doesn't seem to make a difference -- the PDF just opens in the same tab of the web browser, just as before.

The PDF file with added code is:


What am I doing wrong?

(And if you want to see the webpage itself: https://fullbreathmassage.com/writings)

Thanks much for your help!


Link to comment
  • 0

Thank you for explaining this! Now I get a slight idea of what I'm doing :) It works like charm for most links.

BUT NOT for the ones that end with / (slash). The code that I add after / seems to be treated as part of the address and not as code. It still takes me to the target website but I end up with the Page Not Found message.

https://sitename.com/some-blog/article-about-something"target="_blank - OK

https://sitename.com/some-blog/article-about-something/"target="_blank - NOT OK :(

I tried deleting / and then adding "target="_blank => Page Not Found

Please help!

Edited by serrta
Initial Revision


Link to comment
  • 0
On 9/18/2018 at 10:20 AM, talex said:

<script> $(document).ready(function() { $('.summary-thumbnail-container').click(function(event) { event.preventDefault(); // preventDefault first var link = $(this).attr('href'); if(link != '#'){ window.open(link); } }); }); </script>

Thank you for this! It's what I've been looking for 😉 

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