Jump to content

Add SECOND link in Image -> Card

Recommended Posts

Posted

I am using an image in Card format and this allows for a hyperlink in EITHER a button OR the image - not both.

Is there any way to add the link to, say, the button and then programatically add the same link to the image as well?

PS: Currently i am using this in custom CSS to create the border:

//Border for tour card
#block-yui_3_17_2_1_1691819029172_77165, #block-yui_3_17_2_1_1692231844975_8611, #block-yui_3_17_2_1_1692234018828_9144, #block-yui_3_17_2_1_1692234018828_11038 {
 border: 2px solid #6600FF;
 border-top-left-radius: 20px;
 border-bottom-right-radius: 20px;
 padding: 20px,
}

 

Screenshot 2023-08-17 115647.png

Posted

Hi @tuanphan Thanks again for helping me out!

When you say add link to subtitle, would that be wording, like the '#1 Top Pick' or the 'Instagram highlights tour' or something else?

And then what would the script be to turn link to image and CSS to make the link invisible?

Posted
On 8/18/2023 at 6:32 AM, simon.stjohn said:

Hi @tuanphan Thanks again for helping me out!

When you say add link to subtitle, would that be wording, like the '#1 Top Pick' or the 'Instagram highlights tour' or something else?

And then what would the script be to turn link to image and CSS to make the link invisible?

Yes, like this link

image.png.a90118dc58b30f3f9db0dc0e452ef371.png

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

Posted
On 8/21/2023 at 10:58 AM, simon.stjohn said:

@tuanphan Got it - thanks for confirming!

So what would the script be to turn link to image and CSS to make the link invisible?

Can you share link to page where you use image? We can check easier

I don't remember Card Image image ID

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

Posted

Add to Last Line in Code Injection > Footer

<!-- Make link invisible -->
<style>
div.blog-item-inner-wrapper .design-layout-card .image-subtitle p:last-child a {
    display: none !important;
}
</style>
<!-- Make image clickable -->
  <script>
$(".blog-item-inner-wrapper .design-layout-card .intrinsic").click(function(){
		window.location=$(this).find(".image-subtitle p:last-child 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!)

Posted

Hi @tuanphan Thank you so much! I tried this and when I went to save the CSS it returned the error:

 
Syntax Error on line 178

And this line had the start of your code 

<!-- Make link invisible -->

So I am wondering if there is a problem with that line or if I needed to add something or do something different?

 

Posted (edited)
Quote

I tried this and when I went to save the CSS it returned the error:

The code is not CSS and needs to go in Settings > Developer Tools > Code Injection > FOOTER.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Posted

Hi @tuanphan So thanks to Creedon, I got the code in the right place 🤪

Now what I find is when I click on the image in the card on the example page https://baligram.me/day-tours/top-20-bali-tours-on-getyourguide it's just opening the URL https://baligram.me/day-tours/undefined

So I am wondering how its supposed to work - is it supposed to be picking up the URL from another element that is not defined maybe?

  • 2 weeks later...

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.