emm.farines Posted June 11, 2022 Posted June 11, 2022 (edited) Site URL: https://jaguar-grey-rryj.squarespace.com/all-treatments Hello Circle people, In this list section I would like to make each image clickable and link to the relevant page (same links as the buttons, and I want to keep the buttons). https://jaguar-grey-rryj.squarespace.com/all-treatments Would anyone be able to help? Thanks in advance! Emmanuelle. Edited June 11, 2022 by emm.farines
Solution paul2009 Posted June 11, 2022 Solution Posted June 11, 2022 (edited) On 6/11/2022 at 11:36 AM, emm.farines said: In this list section I would like to make each image clickable and link to the relevant page Take a look at the solution I published here: Make Squarespace list items clickable. This takes the link that you've assigned to each CTA button and applies it to the entire list item. This means that users can click the image or any other aspect of an item to trigger the CTA action. Did this help? Please give feedback by clicking an icon below ⬇️ Edited February 22, 2023 by paul2009 Latrippi, Mitchell87632, emm.farines and 2 others 1 4 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
emm.farines Posted June 23, 2022 Author Posted June 23, 2022 On 6/11/2022 at 10:00 PM, paul2009 said: Take a look at the solution I published here: Make Squarespace list items clickable. This takes the link that you've assigned to each CTA button and applies it to the entire list item. This means that users can click the image or any other aspect of an item to trigger the CTA action. Has this post helped you? Let everyone know by clicking an icon below ⬇️ Thank you so much Paul, it has worked perfectly!! 🌟😀🙏
kkedwards87 Posted February 22, 2023 Posted February 22, 2023 Hi @paul2009is there a way to make this code work to open a lightbox? Thanks
tuanphan Posted February 26, 2023 Posted February 26, 2023 On 2/23/2023 at 5:11 AM, kkedwards87 said: there a way to make this code work to open a lightbox? Thanks You will need to use a plugin to enable lightbox first (Maybe enable on button, then use code to make image clickable, use button link) 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!)
STC Posted August 8, 2023 Posted August 8, 2023 @paul2009 This works great but there are certain pages I need to disable this on. Any suggestions?
tuanphan Posted August 11, 2023 Posted August 11, 2023 On 8/9/2023 at 5:17 AM, STC said: This works great but there are certain pages I need to disable this on. Any suggestions? You try moving the code to Page Settings > Advanced > Code Injection (for pages where you want list section clickable) 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!)
STC Posted August 11, 2023 Posted August 11, 2023 11 hours ago, tuanphan said: You try moving the code to Page Settings > Advanced > Code Injection (for pages where you want list section clickable) That didn't seem to work. I'm assuming it's because this code usually goes in the footer injection and on pages you can only put this code into the header injection?
tuanphan Posted August 12, 2023 Posted August 12, 2023 18 hours ago, STC said: That didn't seem to work. I'm assuming it's because this code usually goes in the footer injection and on pages you can only put this code into the header injection? Can you share link to page where you have problem? 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!)
STC Posted August 12, 2023 Posted August 12, 2023 6 hours ago, tuanphan said: Can you share link to page where you have problem? I want the list items clickable on this page https://sgftechcouncil.com but not on this page and a couple others https://sgftechcouncil.com/springfield-tech-community The code seems to prevent external links from opening in a new window and it is difficult to copy text from a list item when needed.
GemmsyA Posted August 16, 2023 Posted August 16, 2023 @paul2009 Is there a way to hide the button and just have the image and title clickable? Thx
paul2009 Posted August 16, 2023 Posted August 16, 2023 4 hours ago, GemmsyA said: Is there a way to hide the button You can hide buttons with CSS, like the example I have provided below. The exact CSS may depend on your site settings and whether you want to hide all buttons. /* Hide all list item buttons */ .list-item-content__button.sqs-button-element--primary.sqs-block-button-element { display: none; } Did this help? Please give feedback by clicking an icon below ⬇️ Mitchell87632, GemmsyA and tuanphan 2 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
GemmsyA Posted August 16, 2023 Posted August 16, 2023 2 hours ago, paul2009 said: You can hide buttons with CSS, like the example I have provided below. The exact CSS may depend on your site settings and whether you want to hide all buttons. /* Hide all list item buttons */ .list-item-content__button.sqs-button-element--primary.sqs-block-button-element { display: none; } Did this help? Please give feedback by clicking an icon below ⬇️ This is perfect, thanks so much. I only have one List section on my site so this is all I need. Really appreciate it. paul2009 1
STC Posted August 22, 2023 Posted August 22, 2023 @paul2009 Any suggestions on the issue I was having with disabling clickable list items on certain pages or sections?
leahraine Posted September 29, 2023 Posted September 29, 2023 @paul2009 do you know of a way to make the links open in a new tab? (I set it within the button itself but it still opens in the same tab) Thanks!!
palacino Posted March 7 Posted March 7 Hi @paul2009 Have you ever noticed a page load jump after applying this code? After I apply the code, the page loads and then "resets" and jumps a few pixels. If I remove the code, this doesn't happen. I can't tell if it's the code or just me. Thanks for any input! https://themissnergroup.squarespace.com/portfolio PW: missner
paul2009 Posted March 7 Posted March 7 I'm not seeing this on other sites, so it's difficult to say why. That said, there are multiple snippets of code and the site is attempting to load three different versions of jQuery 😳 so it may be worth tidying those up and checking again? palacino 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
palacino Posted March 7 Posted March 7 @paul2009 you're right, just noticed the jQuery from other snippets! I bet that's it! Thanks! paul2009 1
dnmddy Posted May 23 Posted May 23 On 9/28/2023 at 8:32 PM, leahraine said: @paul2009 do you know of a way to make the links open in a new tab? (I set it within the button itself but it still opens in the same tab) Thanks!! did anyone figure this out? @paul2009
mutant Posted June 5 Posted June 5 (edited) I tried 2 scripts, one from here which looks like gibberish but it works: https://sf.digital/squarespace-solutions/make-squarespace-list-items-clickable and one from here: https://www.primitusconsultancy.co.uk/blog/how-to-make-squarespace-list-items-clickable but both scripts ignore Squarespace's Open-link-in-new-window settings. Is there a solution to having both clickable list images and being able to open the links in new windows? Any help much appreciated! Edited June 5 by mutant dnmddy 1
tuanphan Posted June 8 Posted June 8 On 6/6/2024 at 5:10 AM, mutant said: I tried 2 scripts, one from here which looks like gibberish but it works: https://sf.digital/squarespace-solutions/make-squarespace-list-items-clickable and one from here: https://www.primitusconsultancy.co.uk/blog/how-to-make-squarespace-list-items-clickable but both scripts ignore Squarespace's Open-link-in-new-window settings. Is there a solution to having both clickable list images and being able to open the links in new windows? Any help much appreciated! Can you share link to page where you use list? 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!)
mutant Posted June 9 Posted June 9 Thanks for checking in on me. Appreciated. Problem is solved: the solution from @fncreativeconsole is the only one that respects the Squarespace "open-in-new-window" settings. Their script here again: <!--Make list items clickable--> <script> // JavaScript code to link list-item-media to the closest button document.addEventListener("DOMContentLoaded", function() { var listItems = document.querySelectorAll('.list-item'); listItems.forEach(function(listItem) { var media = listItem.querySelector('.list-item-media'); var closestButton = listItem.querySelector('.list-item-content__button'); if (media && closestButton) { media.addEventListener('click', function() { closestButton.click(); // Trigger button click when list item media is clicked }); } }); }); </script>
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment