Jump to content

Clickable image in list content item

Recommended Posts

On 9/8/2021 at 9:50 AM, tuanphan said:

You can add a button with link. Then we will give the code to pass button links to image (& use code to remove button later)

Hey, I’ve created buttons, how do I pass it to image ? Thanks 

Link to comment
On 9/13/2021 at 3:08 PM, ElizLdn said:

Hey, I’ve created buttons, how do I pass it to image ? Thanks 

use this CSS, if it doesn't work, please share link to page where you use List, we can check easier

/* Make list images clickable */
li.list-item {
    position: relative !important;
}
.list-item-content__button-container {
    position: absolute !important;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}
a.list-item-content__button.sqs-block-button-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}


 

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 weeks later...
On 9/15/2021 at 4:56 AM, tuanphan said:

use this CSS, if it doesn't work, please share link to page where you use List, we can check easier

/* Make list images clickable */
li.list-item {
    position: relative !important;
}
.list-item-content__button-container {
    position: absolute !important;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}
a.list-item-content__button.sqs-block-button-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}


 

 

Thanks! The code works but only to an extent.

I’m having two issues with it: 

1. The transparency has suddenly stopped working, so you can see the black square when clicking on it. It was working fine before so not sure what happened. Sometimes it works and sometimes it doesn’t so its very inconsistent.

2. The second problem is that when i have just one item in a list, the clickable area covered is not 100%, it only covers a small space, maybe because the image is slightly larger, I’m not sure but it means that you have to click on the very bottom of the picture for it to work instead of clicking anywhere on the picture. 

Link to comment
On 9/30/2021 at 5:10 PM, ElizLdn said:

 

 

Thanks! The code works but only to an extent.

I’m having two issues with it: 

1. The transparency has suddenly stopped working, so you can see the black square when clicking on it. It was working fine before so not sure what happened. Sometimes it works and sometimes it doesn’t so its very inconsistent.

2. The second problem is that when i have just one item in a list, the clickable area covered is not 100%, it only covers a small space, maybe because the image is slightly larger, I’m not sure but it means that you have to click on the very bottom of the picture for it to work instead of clicking anywhere on the picture. 

Can you share link to page where you use list on your site? We can check it again easier

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 months later...
On 9/14/2021 at 11:56 PM, tuanphan said:

use this CSS, if it doesn't work, please share link to page where you use List, we can check easier

/* Make list images clickable */
li.list-item {
    position: relative !important;
}
.list-item-content__button-container {
    position: absolute !important;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}
a.list-item-content__button.sqs-block-button-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}


 

Hi there,

I tried this code but then all of the buttons in all of my list sections disappeared.

When I tried it again deleting the below section, the formatting of my buttons was all off. Any suggestions? I don't need to hide the buttons, just make the images clickable.

This is my site (it's a work in progress): https://tarpon-fox-f79k.squarespace.com/hotels

Thanks so much!

a.list-item-content__button.sqs-block-button-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}
Link to comment
2 hours ago, GP3 said:

the formatting of my buttons was all off. Any suggestions?

I suspect that the issue you are having is the code was designed for user list carousel style and your user list is simple. Two different styles of user lists may require different CSS.

Since you have jQuery installed I suggest a different method. Please see the following.

Let us know how it goes.

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.

Link to comment
On 12/21/2021 at 2:38 AM, GP3 said:

Hi there,

I tried this code but then all of the buttons in all of my list sections disappeared.

When I tried it again deleting the below section, the formatting of my buttons was all off. Any suggestions? I don't need to hide the buttons, just make the images clickable.

This is my site (it's a work in progress): https://tarpon-fox-f79k.squarespace.com/hotels

Thanks so much!

a.list-item-content__button.sqs-block-button-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}

This code will remove butotn & pass button link to image link.

If you want image clickable + Keep button, you can add a text link in Description, then we will give the code to pass link from description to image.

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...
11 hours ago, Dilliaglio said:

@tuanphan could you share the code to keep the button as well please?

Try this code

/* List section - Make clickable - Keep button */
li.list-item {
    position: relative;
}
.list-item-content__description {
    position: static;
}
.list-item-content__description a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}

 

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
19 hours ago, tuanphan said:

Try this code

/* List section - Make clickable - Keep button */
li.list-item {
    position: relative;
}
.list-item-content__description {
    position: static;
}
.list-item-content__description a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}

 

Hi, @tuanphan - I've just tried this but the image link no longer works if the button stays. I'm trying to do this on my home page - link: https://tanyaarya.co.uk 

I'd like to keep the button text (I've removed box formatting so it doesn't look like a button) and then also keep the image as clickable. 

 

Link to comment
On 1/6/2022 at 4:54 AM, thesimpleexplorer said:

Hi, @tuanphan - I've just tried this but the image link no longer works if the button stays. I'm trying to do this on my home page - link: https://tanyaarya.co.uk 

I'd like to keep the button text (I've removed box formatting so it doesn't look like a button) and then also keep the image as clickable. 

 

Can you add text link in item description? Then we will give code to pass text link to image  link (&hide text then)

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 months later...
22 hours ago, moonlitdesign said:

Could I please have code for this same affect for a simple list squarespace 7.1 ? 

@tuanphan
 

Add a text link in description & add this to Design > Custom CSS

/* List section - Make clickable - Keep button */
body li.list-item {
    position: relative;
}
body .list-item-content__description {
    position: static;
}
body .list-item-content__description a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}

 

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 hours ago, tuanphan said:

Add a text link in description & add this to Design > Custom CSS

/* List section - Make clickable - Keep button */
body li.list-item {
    position: relative;
}
body .list-item-content__description {
    position: static;
}
body .list-item-content__description a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
}

 

ABSOLUTE GENIUS thank you this worked a treat!

Link to comment
  • 2 weeks later...

Hello. 

I did this and it works wonderfully BUT then it takes away the swipe option for the list. Is there a way to have the carousel swipable and cklickable? I have a recipe blog and I want my readers to be able to swipe through few posts and click on the image but not just a small button. All the big wordpress food blogs have it but I can't seem to make it work on my squarespace. 

 

Link to comment
On 4/15/2022 at 9:33 PM, Helgamaria1992 said:

Hello. 

I did this and it works wonderfully BUT then it takes away the swipe option for the list. Is there a way to have the carousel swipable and cklickable? I have a recipe blog and I want my readers to be able to swipe through few posts and click on the image but not just a small button. All the big wordpress food blogs have it but I can't seem to make it work on my squarespace. 

 

Can you share link to your site? We can take a look (not sure can help with this)

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...
On 12/25/2021 at 7:50 AM, tuanphan said:

This code will remove butotn & pass button link to image link.

If you want image clickable + Keep button, you can add a text link in Description, then we will give the code to pass link from description to image.

Hi, how to add a text link to dscription?

here is my website link:

https://flower-toucan-p5d7.squarespace.com/

I ahve my lists on first page with section titles as services. I added your code which removed the buttons. I am unable to understand how to add text links to descriptions. can you please help?

Thank you

Link to comment
8 hours ago, Asiya said:

Hi, how to add a text link to dscription?

here is my website link:

https://flower-toucan-p5d7.squarespace.com/

I ahve my lists on first page with section titles as services. I added your code which removed the buttons. I am unable to understand how to add text links to descriptions. can you please help?

Thank you

image.thumb.png.7c34143b1b3dbd51f5931aadf21360e6.pngAfter I add a text link in descrition my text disappears. every thing is linked now but the text does not shows up.

Link to comment
  • 1 month later...

Hi there,

I'm having the same issue - I have a simple list with an image & associated button, but I would like the image to be clickable with the same URL as in the button.

I've attached a screenshot to show you want I mean.

FYI in the future, I'll be adding buttons to the other images in the list when the guides are available, so each image needs to have the URL of it's associated button when I add the button - if that makes sense 🙂

Thanks so much in advance for your help!

Screen Shot 2022-06-01 at 17.12.50.png

Link to comment
3 hours ago, LisaMaf13 said:

I have a simple list with an image & associated button, but I would like the image to be clickable with the same URL as in the button.

See the answer I provided here:

 

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

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.