Jump to content

sheena.levi

Circle Member
  • Posts

    12
  • Joined

  • Last visited

Posts posted by sheena.levi

  1. On 12/6/2023 at 8:59 AM, tuanphan said:

    While waiting for the plugin, you can also try this quick approach to insert images

    First, add this code to Website Tools (under Not Linked) > Code Injection > Footer

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
    $('.list-item-content__description a:contains(".jpg")').each(function() {
      var $t = $(this);
       $(this).contents().filter(function(){ return this.nodeType != 1; }).remove();
      $t.attr({
          src: $t.attr('href')
        })
        .removeAttr('href target');
       $(this).replaceWith(function(){
        return this.outerHTML.replace("<a", "<img").replace("</a", "</img")
    });
      
    });
    });
    </script>
    <style>
    .list-item-content__description img {
        width: 150px;
        height: auto;
    }
    </style>

    Next, edit each List Item >> Add Image URL

    image.png.1a81a5cd84094f5a70cee813b3200494.png

    Highlight image url > Click Link Icon > Paste same image url > then click Gear icon

    image.png.8a862ee966eec37d0f9a1bab5a82167f.png

    Enable this option > Save

    image.thumb.png.ecde531b809ff3394ad1391f70be064e.png

    Result. If it doesn't work, please share link to page where you use Simple List, we can check easier

    image.thumb.png.bf9ffb9723252a6f50ba14039b16210b.png

    Thanks @tuanphan! Is there a way to do this by uploading a local file on the actual website assets? 

×
×
  • 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.