Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-11-06 20:09:15

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,159
Website

Re: How to lazyload images with columns (css) ... !?

Ah, it says force_size is added to the img tag, so that will only be when using smd_thumbnail as a standalone tag and not as a container.

What you could do is add either this to your img tag:

height="<txp:image_info type="h" />" width="<txp:image_info type="w" />"

or this:

style="padding-top: calc(<txp:image_info type="h" /> / <txp:image_info type="w" /> * 100%);"

to your container in your macro.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2018-11-06 20:25:24

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 172
Website

Re: How to lazyload images with columns (css) ... !?

Why the column layout? I hope the flexible leyout (display: flex, flex-flow: row wrap, justify-content: space-around or similar) would be more coherent, more steady, and far lighter.

Offline

#13 2018-11-07 17:15:45

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 720
Website

Re: How to lazyload images with columns (css) ... !?

@jakob … I’ve tried it all but for some reason it’s not working as aspected. I don’t know why but for now I’m happy with the site as it is and will give it another go when I’ve more time. I’ll update this thread if there’s some (good) news. Thanks a lot for your support!

Offline

Board footer

Powered by FluxBB