Jump to content

Connect summary block read more link to source URL

Go to solution Solved by tuanphan,

Recommended Posts

  • Solution

Don't remove any code in your current code.

Add this code to Last Line in Code Injection > Footer

<script>
  $(".summary-item").click(function(){
		window.location=$(this).find(".summary-title a").attr("href"); 
		return false;
	});
</script>

 

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
On 10/30/2023 at 4:57 AM, sarahrab said:

@tuanphan Hm, this code makes the "read more" link start to load the source URL, but then it quickly redirects back to the current page (https://cdlri.squarespace.com/mission). 

I see it works here. Can you check it again?

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
  • 2 weeks later...
12 hours ago, tuanphan said:

Can you share link to summary? I can test code again easier

Yes, here you go. Let me know if you need anything. Thank you. 

https://www.thedoveagency.com/home-2 - the go-to resource library section

https://www.thedoveagency.com/blog - wingbeats section

https://www.thedoveagency.com/blogs - on the actual blog page, the link is still going to the built-in post page - is there a way to make this go to the outbound link a new window? 


Appreciate your help! 

Link to comment
  • 2 weeks later...
On 11/20/2023 at 9:11 AM, Dovely2023 said:

Yes, here you go. Let me know if you need anything. Thank you. 

https://www.thedoveagency.com/home-2 - the go-to resource library section

https://www.thedoveagency.com/blog - wingbeats section

https://www.thedoveagency.com/blogs - on the actual blog page, the link is still going to the built-in post page - is there a way to make this go to the outbound link a new window? 


Appreciate your help! 

Hi @tuanphan just following up on this. Let me know if you have any questions. Thank you!

Link to comment
On 11/20/2023 at 10:11 PM, Dovely2023 said:

Yes, here you go. Let me know if you need anything. Thank you. 

https://www.thedoveagency.com/home-2 - the go-to resource library section

https://www.thedoveagency.com/blog - wingbeats section

https://www.thedoveagency.com/blogs - on the actual blog page, the link is still going to the built-in post page - is there a way to make this go to the outbound link a new window? 


Appreciate your help! 

 

 

On 11/15/2023 at 1:38 AM, Dovely2023 said:

Hi @tuanphan Thank you. How do we alter this to open in a new window? I tried adding the window.open _blank but it's not working. Appreciate your help!

in code I sent above

try window.location

to

window.open

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
  • 3 months later...
On 3/12/2024 at 7:41 PM, tarasollman said:

@tuanphan I'm having this same issue (trying to get the "read more" link on a summary block point to the Source URL instead of the blog post on SS). None of the code I've found above or elsewhere seems to help. Can you (or anybody) assist me?

Site url: https://turquoise-caterpillar-n778.squarespace.com/news
PW: WITCHES

 

I see it already open Source Url here

 

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
  • 4 months later...

@tuanphan I tried using the code above but it didn't work.

I currently have the below but I want the button to link to the source url.  

Site: https://manatee-saxophone-eflm.squarespace.com/
Password: kingfish

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script><script>jQuery(function($){    $("a.summary-read-more-link").html(function() {return $(this).html().replace("Read More →", "Book now");});});</script>

and

.sqs-block-summary-v2 .summary-item-record-type-text .summary-read-more-link {
background: #000000;
  padding: 10px;   /*How much padding you want the button to have internally*/  color: #ffffff; /*Colour of the text when user hovers. Change hex value to change colour*/ 
width: 35%;   /*How much of the summary block item you would like the button to cover, horizontally*/  
text-align: center !important; /*Use left, right or center*/ 
margin-top: 30px !important; /*Margin between button and text above*/ 
transition: 0.2s; /*Transition speed. Increase for slower, decrease for faster*/ 
font-family: OstiaAntica-LightItalic !important; 
text-transform: uppercase; /*Use uppercase, lowercase or capitalize*/

  &:hover {
background: #383637;     /*Background of the button when user hovers. Change hex value to change colour*/  
color: #ffffff; /*Colour of the text when user hovers. Change hex value to change colour*/ 
transition: 0.2s; /*Transition speed. Increase for slower, decrease for faster*/
}    
}

 

Edited by maddieturnbull
Link to comment
On 7/30/2024 at 8:38 AM, maddieturnbull said:

@tuanphan I tried using the code above but it didn't work.

I currently have the below but I want the button to link to the source url.  

Site: https://manatee-saxophone-eflm.squarespace.com/
Password: kingfish

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script><script>jQuery(function($){    $("a.summary-read-more-link").html(function() {return $(this).html().replace("Read More →", "Book now");});});</script>

and

.sqs-block-summary-v2 .summary-item-record-type-text .summary-read-more-link {
background: #000000;
  padding: 10px;   /*How much padding you want the button to have internally*/  color: #ffffff; /*Colour of the text when user hovers. Change hex value to change colour*/ 
width: 35%;   /*How much of the summary block item you would like the button to cover, horizontally*/  
text-align: center !important; /*Use left, right or center*/ 
margin-top: 30px !important; /*Margin between button and text above*/ 
transition: 0.2s; /*Transition speed. Increase for slower, decrease for faster*/ 
font-family: OstiaAntica-LightItalic !important; 
text-transform: uppercase; /*Use uppercase, lowercase or capitalize*/

  &:hover {
background: #383637;     /*Background of the button when user hovers. Change hex value to change colour*/  
color: #ffffff; /*Colour of the text when user hovers. Change hex value to change colour*/ 
transition: 0.2s; /*Transition speed. Increase for slower, decrease for faster*/
}    
}

 

Which page are you referring to? I dont' see button on homepage

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
On 7/30/2024 at 8:38 AM, maddieturnbull said:

@tuanphan I tried using the code above but it didn't work.

I currently have the below but I want the button to link to the source url.  

Site: https://manatee-saxophone-eflm.squarespace.com/
Password: kingfish

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script><script>jQuery(function($){    $("a.summary-read-more-link").html(function() {return $(this).html().replace("Read More →", "Book now");});});</script>

and

.sqs-block-summary-v2 .summary-item-record-type-text .summary-read-more-link {
background: #000000;
  padding: 10px;   /*How much padding you want the button to have internally*/  color: #ffffff; /*Colour of the text when user hovers. Change hex value to change colour*/ 
width: 35%;   /*How much of the summary block item you would like the button to cover, horizontally*/  
text-align: center !important; /*Use left, right or center*/ 
margin-top: 30px !important; /*Margin between button and text above*/ 
transition: 0.2s; /*Transition speed. Increase for slower, decrease for faster*/ 
font-family: OstiaAntica-LightItalic !important; 
text-transform: uppercase; /*Use uppercase, lowercase or capitalize*/

  &:hover {
background: #383637;     /*Background of the button when user hovers. Change hex value to change colour*/  
color: #ffffff; /*Colour of the text when user hovers. Change hex value to change colour*/ 
transition: 0.2s; /*Transition speed. Increase for slower, decrease for faster*/
}    
}

 

Your above code only replace the text Read more to Book Now

Based on @tuanphan share code, we can change a little bit to match on your site

<script>
  $('.summary-read-more-link').click(function(){
    window.location=$(this).closest(".summary-item").find('.summary-thumbnail-container.sqs-gallery-image-container').attr("href"); 
    return false;
  });
</script>

Hope it can help

Press 👍  or mark my comment as solution if you find my sharing useful

🆒 Squarespace pinchzoom lightbox plugin (affiliate link)

👁‍🗨 360 degree photo viewer (affiliate link)

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.