Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-04-13 18:01:52

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

image class in admin area

Just a note that I’ve raised issue 174 regarding the use of class="image" in the admin area…

On the images listing page table, there is a class of “image” on the td tag like so:

<td width="80" class="image thumbnail"><a href="#"><img src="#" alt="" title='#' width='#' height='#' /></a></td>

On the subsequent image edit page the class="image" is directly on the img tag.

At the moment this class is pretty much redundant, since if an admin theme author tried to use it to style up images it would instead also style up the td tag on the table. It should be moved to the img tag on the image listing page to keep things consistent and make this class worth using in CSS rules.

Last edited by philwareham (2012-04-13 18:02:17)

Offline

#2 2012-04-14 08:56:19

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

Re: image class in admin area

Otoh, img.image feels so silly. :-p.


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

Offline

#3 2012-04-14 09:04:58

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

Re: image class in admin area

It does seem silly, but it’s even more silly to have it and then put it on a td cell. If you are going to have it then it should be on the img tag alone (besides, I can think of a few uses for it).

Last edited by philwareham (2012-04-14 09:10:31)

Offline

#4 2012-04-14 11:58:07

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

Re: image class in admin area

No I mean that specific choice of class name ‘image’ applied to the img element. I can see the point of that particular class name as used on td or whatever element wrapping that image.


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

Offline

#5 2012-04-14 12:09:30

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

Re: image class in admin area

The td tag already has a class of thumbnail applied to it.

Offline

#6 2012-04-14 12:27:02

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

Re: image class in admin area

::sigh:: you’re missing my point, or perhaps I’m really obscure.

What I’m saying is that the specific choice of name is silly if applied to an img element. You want/need a class for a specific set of images, name it thus. .image is way too generic for your purpose. But using that specific class name applied to a wrapping element around images might make sense – just as there is a class .date that is attached to th / td (Articles tab, a column that contain dates), and on the Write tab, it is use on p containing date input fields (and possibly other places, I forgot right now).

(it is of course inconsistent to have the .image class attached to an image in one place and to a td in anther place – no discussion there).


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

Offline

#7 2012-04-18 21:17:36

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

Re: image class in admin area

I’m confused. And I don’t entirely mean about the discussion here, I mean in how I put the thing together in the first place: it’s a mess! We have:

  • List pane thumbs: <td class="image thumbnail">, then an <img> inside that wrapper, with no class
  • Edit pane image: <td> with no class, then inside an <img id="image-fullsize" class="image fullsize">
  • Edit pane thumb: <td class="thumbwrapper">, then <img class="image thumbnail">

Inconsistency central.

I forget which classes/IDs were already defined in prior versions (and hence which I left alone for b/c reasons). I can sort of see why certain things were named to try and ‘classify’ the elements, analogous to the things Philippe mentions regarding the date columns in tables.

The trouble here is that an <img> tag represents an image. It’s an image. There’s no real need to make a classification other than to say something about the type of image it is (thumbnail, full-size) and its orientation (portrait, landscape, square). Perhaps the container tag can be classed an “image” in all cases and then the actual <img> inside should be one of either thumbnail or full-size (errr, or fullsize?). I’m open to suggestion as to where the orientation should go: wrapper or on the image itself. Does the orientation of the thumbnail matter? Or should it just be for the full size image? My thinking behind adding the orientation is to allow mobile devices to make decisions on how to handle clipping or scaling. With that in mind, where does it make sense to put it?

If I can get a handle on the best way to label all this up I’ll also look into Issue 177 at the same time.


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

#8 2012-04-18 21:47:59

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

Re: image class in admin area

Offline

#9 2012-04-18 21:52:50

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

Re: image class in admin area

If that’s what you want, sure. I’ll let someone else have a say first and if there are no objections I’ll commit your patch.


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

#10 2012-04-18 22:10:20

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

Re: image class in admin area

Another thing might be to remove thumbnail class completely from img tag (because it’s used already on td cells). We would then just have for img tags:

content-image which refers to any image that is user content, and content-image fullsize which is the actual size version.

As you say though, I’m also open to hearing any other ideas in case someone can provide anything better.

Offline

#11 2012-04-19 08:09:52

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

Re: image class in admin area

I like the class ‘content-image’ that Phil proposes; it is reasonably well descriptive for the purpose.

I think the class ‘thumbnail’ could be dropped, and keep the existing ‘image’ class reserved for containers of said content images.
Theme authors can select the thumbnail images with .content-image:not[class="fullsize"] {}


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

Offline

#12 2012-04-23 12:01:15

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

Re: image class in admin area

OK, I’m happy with that. Can we get this into the SVN soon?

Offline

Board footer

Powered by FluxBB