Jump to content

[Share] List Simple Image clickable

Recommended Posts

Posted

You can follow these quick steps to make List Simple (People section) image clickable.

If it doesn't work, you can send link to page where you use List, I will check again.

#A. Use link in Item Description

We will add link to item description, then turn this link to image.

#1. First, add a Link in List item description

image.png.901cd0e3e499dea32323c6580830b8a0.png

We will have

image.png.60672ec1b9ff2488ee1d426923626433.png

#2. Find ID of List Simple Section

In my example, it is:

section[data-section-id="673db68dc3687009034aeeb9"]

image.png.f8d1a8b72a2f81fbc0fdb149b62a0f0b.png

#3. Use this code to Code Injection Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
    function wrapImageWithLink() {
        const listItems = $('section[data-section-id="673db68dc3687009034aeeb9"] .list-item');
        listItems.each(function() {
            const img = $(this).find('.list-item-media img');
            const link = $(this).find('.list-item-content a');
            if (img.length && link.length) {
                const newLink = $('<a>').attr('href', link.attr('href'));
                img.before(newLink);
                newLink.append(img);
            }
        });
    }
    wrapImageWithLink();
});
</script>

image.png.311eab98b7d45a913d877d9e70872449.png

#4. To hide Link in List item description, you can use this CSS code under

<style>
section[data-section-id="673db68dc3687009034aeeb9"] p:has(a) {
    display: none;
}
</style>

image.png.2160ca78101033585455158d5e77531c.png

#B. Use Button Link

We will turn item button link to image.

#1. You can enable Item button

image.png.f83784119dcb9b8def934ba4f602504d.png

then add link to item button

image.png.7ac422f2fc5c3e954e880a1ce5902012.png

#2. Find ID of List Simple Section

In my example, it is:

section[data-section-id="673db68dc3687009034aeeb9"]

image.png.5a14544c329ded45e28c9ffb736f1e2a.png

#3. Use this code to Code Injection Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
    function wrapImageWithLink() {
        const listItems = $('section[data-section-id="673db68dc3687009034aeeb9"] .list-item');
        listItems.each(function() {
            const img = $(this).find('.list-item-media img');
            const link = $(this).find('.list-item-content__button-wrapper a');
            if (img.length && link.length) {
                const newLink = $('<a>').attr('href', link.attr('href'));
                img.before(newLink);
                newLink.append(img);
            }
        });
    }
    wrapImageWithLink();
});
</script>

image.png.c2eb42459ad5d6d89542e6f8022f7b6c.png

#4. To hide buttons, you can add this code under

<style>
section[data-section-id="673db68dc3687009034aeeb9"] .list-item-content__button-wrapper {
    display: none;
}
</style>

image.png.147d07a7814c679b95a55247539adfc7.png

#C. Use CSS code

Similar #B, but here we will use CSS code in Personal Plan (Personal doesn’t support Code Injection)

#1. You can enable Item button

image.png.9c53de3b4de1dcc27fb200cefbb43b32.png

then add link to item button

image.png.510094573053666bef4c45125a7be607.png

 #2. Find ID of List Simple Section

In my example, it is:

section[data-section-id="673db68dc3687009034aeeb9"]

image.png.5a14544c329ded45e28c9ffb736f1e2a.png

#3. Use this code to Custom CSS box

section[data-section-id="673db68dc3687009034aeeb9"] {
  li.list-item {
    position: relative;
}
.list-item-content__button-container {
    position: static;
}
.list-item-content__button-container a {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
    border: none !important;
}
.list-item-content__button-container {
    position: static !important;
transform: unset !important;
}
a.list-item-content__button.sqs-block-button-element:before {
    visibility: hidden;
}
.user-items-list-carousel__slide {
    pointer-events: initial !important;
    user-select: unset !important;
}
.user-items-list-carousel__gutter {
    cursor: pointer;
}
.list-item-content--hidden {
    display: block !important;
}}

image.thumb.png.04fb2dcb6e038924f42714aa005acb2a.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

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

  • Replies 0
  • Views 59
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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.