Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#397 2023-06-08 05:38:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: smd_thumbnail: manage multiple thumbnails of your images

Thanks for the report. I’ll see if I can investigate on the shiny new demo server that has PHP 8.3 on it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#398 2023-06-08 07:06:12

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,220
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

Hmm. Scratch that, it seems there is something in my .htaccess that prevents the redirect to work. Strange as there is nothing special there…

And of course after disabling and enabling this or that for testing, everything keeps on working…

Gremlins?


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#399 2023-06-08 23:46:45

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,220
Website

Re: smd_thumbnail: manage multiple thumbnails of your images

phiw13 wrote #335495:

Gremlins?

Not gremlins :-(. Strict(er) CSP at work. The redirect-after-upload is inline-script dependent, here

I thought I had hacked my way out with tons of "script-src-attr 'unsafe-hashes' 'SHA256-XXXXXXX'. Still some devils are popping up.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#400 2023-06-09 05:33:07

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: smd_thumbnail: manage multiple thumbnails of your images

Good catch. That should use script_js(). Will fix, thank you.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#401 2023-08-10 09:51:26

Steven
New Member
Registered: 2023-08-10
Posts: 1

Re: smd_thumbnail: manage multiple thumbnails of your images

maniqui wrote #288361:

An smd_thumbnail snippet for those who want to do responsive images using the img / srcset / sizes combo.

In your form or page template:

<txp:images>...

<!-- img-srcset form -->...

Of course, you have to tune your srcset and sizes attributes to what you are trying to achieve.
Here is an excellent article on the topic:
ericportis.com/posts/2014/srcset-sizes/

See also:
scottjehl.github.io/picturefill/

Edit: forgot to add a wrapping <txp:images> that would provide the necessary image id (<txp:image_info type="id" />) that is “fed” to <txp:smd_thumbnail id="..." />. Added alt attribute too.

maniqui wrote #288459:

You are right, Phil. I always forgot that damned alt attribute.

To do it exactly correct: alt=’<txp:image_info type=“alt” />’
Thanks for this snippet. Very usefull. Using TXP again after 6 years. A bit ‘ how did I do that?’ but it is so intuitive to use. Great cms.

Offline

Board footer

Powered by FluxBB