Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#133 Today 09:51:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,346
Website GitHub Mastodon Twitter

Re: Automatic thumbnails for Textpattern

I’ve been following this thread since it started, but admittedly, I had nothing to add.

Now that it is becoming more real, I have a question.

On txp classic, we have a full size image and a thumbnail. We can set up txp for the full size image to be 1420×600px and for the thumbnail to be 200×300px or whatever dimensions we want for the site design. If we do not like the automatically generated thumbnail, we have a choice of replacing it.

Will we have this type of functionality with this?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#134 Today 10:10:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,196
Website GitHub

Re: Automatic thumbnails for Textpattern

colak wrote #341687:

On txp classic, we have a full size image and a thumbnail. We can set up txp for the full size image to be 1420×600px and for the thumbnail to be 200×300px or whatever dimensions we want for the site design. If we do not like the automatically generated thumbnail, we have a choice of replacing it. Will we have this type of functionality with this?

Forget any (automatic) thumbnail you decide to use for the admin side. It has no bearing on the site design. It’s only for you to see on the back-end, and the size of thumb is determined by the admin theme prefs (if the theme exposes them, otherwise it defaults to 200px square cropped).

On the public site your <txp:thumbnail width="400" /> (or whatever size you choose) determines the size of image you let visitors see. Each thumbnail is created at that size on the fly for you and cached.

If you want to override the automatic thumbnail creation and choose one of your own, like you do now, then that’s the only thumb size you’ll have available to your public site and your <txp:thumbnail /> tag will shrink and stretch that image as it does now.

Edit: although if you want to override it and use an automatic thumb at any time you can use something like <txp:image thumbnail="2" width="350" crop="2x3" /> to generate one with those dimensions on the fly.

Thumbnail = 0: no thumb.
Thumbnail = 1: custom thumb (as now).
Thumbnail = 2: automatic thumb (requires at least a width / height or crop attribute to function).

Last edited by Bloke (Today 10:17:12)


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

#135 Today 17:01:32

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,346
Website GitHub Mastodon Twitter

Re: Automatic thumbnails for Textpattern

So, for our site, I will need to replace all <txp:thumbnail /> instances to <txp:image thumbnail="2" />?

It will not be a big chore, but it would be good to be prepared.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#136 Today 17:48:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,196
Website GitHub

Re: Automatic thumbnails for Textpattern

colak wrote #341690:

So, for our site, I will need to replace all <txp:thumbnail /> instances to <txp:image thumbnail="2" />?

No, that won’t help. It can’t guess what size images you want. You need to tell it. You could take the opportunity to convert all your <txp:thumbnail /> tags to <img srcset=... > and put a bunch of <txp:thumbnail /> or <txp:image thumbnail /> tags at widths for each breakpoint. That would give your site a mobile step up and improve pagespeed.

As it stands, for backwards compatibility, nothing changes. You could choose to:

  1. Manually override your image tags with thumbnail="2" width="400" which would force automatic thumbs at that width to be created.
  2. Use the admin side multi-edit tool to convert a bunch of thumbnails to “automatic”. That means if you use <txp:thumbnail width="350" /> or <txp:image thumbnail width="350" /> (valueless thumbnail) on your site, it will use whatever “type” of thumbnail is set for that image, by default. Only if you specifically override the thumbnail attribute with a value will it try to render that specific type of thumbnail.

Does that clear things up a bit?


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

Board footer

Powered by FluxBB