Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-06-23 13:15:01

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Adding more consistent image functionality

Bloke wrote:

I mean, there could be a case for <txp:image_info type="blah" /> where ‘blah’ is one of alt, caption, id, name, ext… etc yet :-p It’s a case of how far we go with that idea.

I think this is not gone too far. All meaningful image information stored in the database should be displayable by core tags, like is for articles or comments. There are 27(!) comment related core tags compared to 4 for images. If TXP wants to move from blog towards CMS, it is inescapable to enhance anything image related.
The current need for the appliance of plugins for this task is like a depreciation for the object “image”. So, anything that makes it more self-evident to handle images and image related info and does this potentially easier than the way upm_image or hak_image do (i.e. sparing us the detour via “extra forms”) is a progress for the users and therefore to be welcomed.

But such due enhancements can’t stop short of the TXP UI: The image list deserves the same editing options as the article list. The image_edit page deserves a shortcut link to the categories tab for creating or editing categories, the write tab deserves a shortcut link to the image_edit page (even with multiple images inserted), think of the steps necessary to edit a caption or an alt tag. Both links are probably realisable with very little extra code. Uploading images is still an ordeal, esp. lots of, esp. when thumbs have to be created in Photoshop. There are prefs for image quality treatment hard-coded in the core: Why not release them as user preferences?

Keith took the words right out of my mouth: YES! PLEASE! :)

[ Sorry for basically being a little OT, but you invited the masses. ]


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#14 2008-06-23 13:32:52

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

Re: Adding more consistent image functionality

Thanks for your input Uli. Always welcome.

uli wrote:

The image list deserves the same editing options as the article list.

That’s done I believe, as far as can be done anyway given that there is limited information in the database to store against an image.

The image_edit page deserves a shortcut link to the categories tab for creating or editing categories

I concur. Not sure if that’s part of this changeset though, it should probably be an additional part of the back-end reshuffling that’s going on now. I just focused on the client side here because, according to the rules of patch submission, putting too much into one changeset makes it difficult to back out later and reduces the chance of adoption.

the write tab deserves a shortcut link to the image_edit page (even with multiple images inserted), think of the steps necessary to edit a caption or an alt tag.

Again, probably a useful back-end step. In the interim, jm’s latest plugin is a wonderful addition to the image/article workflow.

Uploading images is still an ordeal, esp. lots of, esp. when thumbs have to be created in Photoshop.

Yes. I would guess that this is still probably better served with a plugin since it’s really “outside” the scope of the predominantly article-based TextPattern at present. People who want multi-file uploads and image management have to jump through hoops anyway to link articles to images so a plugin is a good solution to help bridge that gap.

We’re a little thin on the ground with multi-upload/image management plugins right now, but *cough* well you never know your luck if you wait a bit ;-)

There are prefs for image quality treatment hard-coded in the core: Why not release them as user preferences?

No idea. Never spotted those. Might be a nice idea as a separate feature request? If it’s just a few numbers it shouldn’t be too tricky to move to the Prefs tab.

Last edited by Bloke (2008-06-23 13:35:57)


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

#15 2008-06-23 13:59:27

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Adding more consistent image functionality

Damn, completely forgot to say how much I appreciate your advance! :)

And how much hope this thread gives me in various aspects! ;)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#16 2008-06-23 15:22:02

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Adding more consistent image functionality

I have to say that it has always niggled me a bit that you can’t simply extract the image caption text with a simple tag. Yes I know you can do it with a plug-in but why should we have to use a plug-in to extract what could be considered as useful data that is entered into admin? I have a new section in mind for thebombsite, or to be more accurate, an old section resurrected in a new format, where image caption would be very useful.

Stef – both my sites are using SVN but if you could email the full files over I can do a comparison and make any necessary mods. then I can give it a whirl and see what happens.

I think if you wanted it to get into 4.0.7 you would need to do a diff against the current development revision anyway just to make it a bit easier for the devs. but having said that there are already some major upgrades in there which are going to take some people a while to fully get their heads around exactly what they have in their hands so it might be a case of “too much too soon” if this where added in as well. I mean, we don’t want to get into the realms of introducing major bugs because things haven’t been tested fully. I could mention a certain blogging platform where security updates are a regular part of life. But I won’t. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#17 2008-06-23 15:32:48

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Adding more consistent image functionality

Just drop here to admire this working and say: “Please, consider adding a textilizing option to the caption(s) tag”. If you haven’t already, of course. Should I provide some rationale for this?… :)

Offline

#18 2008-06-23 15:39:00

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

Re: Adding more consistent image functionality

thebombsite

You got mail.

Zanza wrote:

Should I provide some rationale for this?…

Yes please.


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

#19 2008-06-23 15:42:27

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Adding more consistent image functionality

Thanks Stef. Got it. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#20 2008-06-23 16:01:04

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Adding more consistent image functionality

Bloke wrote:

Should I provide some rationale for this?…

Yes please.

Actually, I ask for textilize and dumbdown. The reasons: To insert link. To format caption. To have Unicode character correctly converted. Captions are not always inserted in the “title” attribute, they can also be displayed as html, like in simple photoblogs or portfolios. In those cases textile and dumbdown are very useful. I hope this is valuable.

PS: This was one reason for my bos_image_display plugin, that I hope I will need no more.

Last edited by Zanza (2008-06-23 16:02:56)

Offline

#21 2008-06-23 16:12:37

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

Re: Adding more consistent image functionality

Zanza wrote:

The reasons: To insert link. To format caption. To have Unicode character correctly converted.

OK, I’m not sure I quite follow (since old-fashioned ASCII is good enough for English!) but the caption and alt both automatically set the escape function to “html” as stuart suggested and wet implemented recently.

I’m not sure that directly addresses your concern but I shall look at bos_image_display and see what you have done in the code. If I can understand it — I’m not very good with character set issues — and it looks useful I’ll see what could be rolled in here.

I do want to try and keep the tags working the same as other TXP tags in terms of how they escape things and deal with character set issues so it may be that there’s not much I can do in this case without complicating this further!

Thanks for the info.


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

#22 2008-06-23 17:11:01

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Adding more consistent image functionality

The reason for not adding separate tags just to display various bits of image info is mostly to avoid a truckload of duplicate code. It doesn’t reduce functionality, just the amount of code needed to achieve that functionality.

Offline

#23 2008-06-23 17:37:39

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Adding more consistent image functionality

Bloke wrote:

Zanza wrote:

The reasons: To insert link. To format caption. To have Unicode character correctly converted.

OK, I’m not sure I quite follow (since old-fashioned ASCII is good enough for English!) but the caption and alt both automatically set the escape function to “html” as stuart suggested and wet implemented recently.

Yes, this is good to put them in alt and title attribute. i.e., if you have single quote or ampersand in them and you not escape them, you’ll get an error in validation.

But this is not enough for some “extended” uses of caption. If caption is meant to be displayed in the html, just below the photo, then is reasonable to have some options to control the markup a bit.

I’m not sure that directly addresses your concern but I shall look at bos_image_display and see what you have done in the code. If I can understand it — I’m not very good with character set issues — and it looks useful I’ll see what could be rolled in here.

My code is a messy. But I can post here the concept, that is very easy and uses standard txp funxtions. I just provided a textilize attribute and then check for it:

if ($textilize == 1) {
include_once txpath.'/lib/classTextile.php'; 
$textileThis = new Textile();
$caption = dumbDown($textileThis->TextileThis($caption));
}

I just demand for an option as simple as that where the caption can be displayed.

Obviously, if there was a txp tag that can be wrapped around the image_caption tag and tha does the same (textilize and dumbdown), than it won’t be necessary. Added: Actually, I realized that maybe dumbDown is not needed… As that function transform unicode special characters and entities in a “sanitized” plain english letter. I just have to remember WHY I put it there, there should have been a reason… The textile part anyway is valid.

So I don’t know what’s the right way to do this. I used this solution, but a better one is welcomed.

I just think that, for internationalization and better caption formatting, they should be included.

Discussion opened, of course!

Last edited by Zanza (2008-06-23 17:52:49)

Offline

#24 2008-06-23 18:24:58

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Adding more consistent image functionality

Zanza wrote:

…I just provided a textilize attribute…

Why is this better than, say, using upm_textile?

Offline

Board footer

Powered by FluxBB