Jump to content

Adding Links to List Section Images

Go to solution Solved by paul2009,

Recommended Posts

  • 7 months later...
  • 3 months later...
5 hours ago, wellnessnewzealand said:

Hi there, Is there way to have a link on the image or title for each list item that takes you to another page on the site and then the button link which links to different page/site?

Thanks, Sarah

You can share link to page where you use List, I can take a look

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 weeks later...

Is anybody having issues attaching links in list items in 7.1 today? I added a section from people, a carousel list and when I try to attach my link, by pressing the button "Attach Link"  the option disappears just to show me the button text. Am I missing something, I tested it in Chrome and Safari and it's happening in both...I've refreshed, logged in and out and it still won't work. 

Link to comment
32 minutes ago, Pip1 said:

Is anybody having issues attaching links in list items in 7.1 today?

See 

 

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.

Link to comment
  • 1 month later...
On 11/28/2023 at 2:15 PM, zmcnees said:

thanks for this code! Is there a way to make the links open in a new window? I tried altering with ChatGPT but it didn't work. 

the solution from @fncreativeconsole is the only one that respects the Squarespace "open-in-new-window" settings.

 

<!--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>
Link to comment
  • 2 weeks later...

@tuanphan I have used the code provided on this thread to hyperlink every list item. I am also using the following CSS to add a hover effect, however you can see that the border radius I applied to the image doesn't translate on hover?

https://www.oppidaneducation.kr/home (2nd section)

 

.user-items-list-simple .list-image {
  border-radius: 15px 15px 0px 0px !important;
}
  
    .list-item img {
       transform: scale(1); 
     transition: 500ms;
       overflow: hidden !important;
}
  
  .list-item:hover img {
       transform: scale(1.05); 
     transition: 500ms;
}

 

Link to comment
20 hours ago, benstevens05 said:

@tuanphan I have used the code provided on this thread to hyperlink every list item. I am also using the following CSS to add a hover effect, however you can see that the border radius I applied to the image doesn't translate on hover?

https://www.oppidaneducation.kr/home (2nd section)

 

.user-items-list-simple .list-image {
  border-radius: 15px 15px 0px 0px !important;
}
  
    .list-item img {
       transform: scale(1); 
     transition: 500ms;
       overflow: hidden !important;
}
  
  .list-item:hover img {
       transform: scale(1.05); 
     transition: 500ms;
}

 

Use this code under

.list-item-media-inner {
    overflow: hidden;
    border-radius: 15px 15px 0px 0px !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

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.