Jump to content

Summary Content to Open in New Window

Recommended Posts

Site URL: https://www.thelieselotte.com/home-2

Hello everyone, 

I am looking for a custom code that allows me to open images in a summary block to open in a new window/tab. I looked at every entry in this forum and asked Squarespace support, but none of the solutions worked. 

I have a summary block at the top of my homepage displaying different art prints of mine. It looks like a gallery block, but it is the summary wall. I like the masonry layout of this one and would like to keep it. The problem: My art prints are available in my Etsy store and every image links to the product page on Etsy. But it doesn't open in a new tab, which makes people leave my site. Not ideal.

 

Could someone help me out and let me know what code to use? 

Squarespace 7.0
Foster Template
https://www.thelieselotte.com/home-2 

Link to comment
  • Replies 4
  • Created
  • Last Reply

Add to Page Settings > Advanced > Header

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('a.summary-thumbnail-container.sqs-gallery-image-container').attr('target','_blank');
});
</script>

Disable Ajax Loading if the code doesn't work. https://support.squarespace.com/hc/en-us/articles/115000253288-Ajax-loading

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
11 hours ago, tuanphan said:

Add to Page Settings > Advanced > Header


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('a.summary-thumbnail-container.sqs-gallery-image-container').attr('target','_blank');
});
</script>

Disable Ajax Loading if the code doesn't work. https://support.squarespace.com/hc/en-us/articles/115000253288-Ajax-loading



THANK YOU! That works! And it works with or without Ajax Loading. 
 

Link to comment
  • 2 months later...
On 8/4/2020 at 3:40 PM, tuanphan said:

Add to Page Settings > Advanced > Header


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('a.summary-thumbnail-container.sqs-gallery-image-container').attr('target','_blank');
});
</script>

Disable Ajax Loading if the code doesn't work. https://support.squarespace.com/hc/en-us/articles/115000253288-Ajax-loading

@tuanphan Is there a similar solution for the Flatiron template: https://www.museandcompany.com/#/crunchy-roll-headquarters/ Opening a gallery image into a new window (last image in this gallery).

Target=blank does not work on these.

Link to comment
  • 1 month later...
On 10/20/2020 at 3:25 AM, ekspohz said:

@tuanphan Is there a similar solution for the Flatiron template: https://www.museandcompany.com/#/crunchy-roll-headquarters/ Opening a gallery image into a new window (last image in this gallery).

Target=blank does not work on these.

Hi. Have you found the solution yet?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Archived

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.