Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2016-07-12 09:32:35

Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Any work on bringing responsive images to Textpattern?

I use responsive images in Textpattern on my site via smd_thumbnail plugin – it takes some dedication and initial setup of pixel ratios but it works – I agree some better core image features would be very welcome at some point.

Also as a side note, you can polyfil the HTML5.1 picture and srcset tags for older browsers using Picturefill.


#14 2016-07-12 12:23:19

From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: Any work on bringing responsive images to Textpattern?

I concur with Phil, and look forward to Aeyoun’s work on forking my plugin (or a pull request thereof, I’m easy either way).

For core support in some undisclosed timeframe, what actually needs to happen? From my — extremely limited — point of view, one of the barriers to entry seems to be our storage and use of image dimensions in the database. Is that true or not?

That is, if we dropped the image sizes entirely — from the DB and from the output of the various image tags — would that make it easier to then move forward with some kind of responsive support? Or do the image sizes in the DB and injected into the img tags make no difference at all to the ability to successfully employ scrset/picture elements? Should the image dimensions be desired sizes and not actual dimensions? Do we need both? Some kind of actual sizes for each image, as we have now, and some range of values or percentage scaling over which that image is “valid”?

Whether dimensions help or hinder, what’s next? What do we need to actually do in terms of a) database support, b) interface support, to allow this to move forward?

A long-overdue grid of images is on the cards for the UI (currently available via plugin). A plugin for creating multiple image profiles exists. Somewhere in between these (or possibly outside them) lies the ability to manage multiple images and thumbnails in a usable and intuitive manner. Certainly, smd_thumbnail isn’t it, as it doesn’t cope with varying aspect ratios and pixel densities particularly well. And the interface is a bit clunky.

What needs to happen? How will it look? How will it work? Bring ideas to this table, please. Or put forward some code as a core pull request.

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


#15 2016-07-12 12:52:40

From: Germany
Registered: 2005-01-20
Posts: 4,595

Re: Any work on bringing responsive images to Textpattern?

I do the same as Phil and others: smd_thumbnail and picturefill. You can make yourself an own tag, e.g. txp:xyz_picture or txp:xyz_photo for use in the body field using smd_macro or rah_beacon.

One problem with the srcset variant, is that while it’s straightforward enough to output the 1280w image width, it’s harder to automate the sizes attribute that lets the browser know how large it will be displayed in the layout at the different media breakpoints. Mostly, you need to set that manually.

TXP Builders – finely-crafted code, design and txp


Board footer

Powered by FluxBB