Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-07-26 01:20:57

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,253
Website

Image tab - upload behaviour

Have been a bit out of touch with Textpattern for a while, so be gentle!

My query is about Image Tab behaviour when uploading a new image. In TXP 4.5 & 4.6 immediately after uploading an image, the Image Edit tab would be presented to the user.

In TXP 4.7 & 4.8 this is no longer the case. After uploading an image the user stays on the Image List tab (albeit with the new image ticked in the list).

Is this deliberate or am I missing something? When uploading an image I would really want to be in immediate edit mode to set alt text, caption etc. The 4.7/4.8 system forces an extra step into the process. Only when uploading multiple images does remaining on the Image List tab make sense to me.

Related to this … in the olden days I’d plugin-terfere with $step to force a reroute of tab behavour. But now in the modern-ajaxy age is there a callback to do something similar?

Offline

#2 2020-07-26 07:37:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,639
Website

Re: Image tab - upload behaviour

gomedia wrote #324853:

When uploading an image I would really want to be in immediate edit mode to set alt text, caption etc. The 4.7/4.8 system forces an extra step into the process. Only when uploading multiple images does remaining on the Image List tab make sense to me.

That is a very good point. Not sure how easy it is to divert to a different step on completion based on the number of files uploaded, due to the Ajax nature of the multi-upload process. Nor whether it produces inconsistent UX. The same could be true of the Files panel. Maybe Oleg has some thoughts here?

Related to this … in the olden days I’d plugin-terfere with $step to force a reroute of tab behavour. But now in the modern-ajaxy age is there a callback to do something similar?

In the specific case of uploads, you can meddle via JavaScript:

textpattern.Relay.register('uploadEnd', function(event) {
   /// Do some stuff
});

But I’m not entirely sure how you get at the number of files processed. There’s an uploadCount variable but I’m not clever enough to figure out how to access 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

#3 2020-07-26 08:22:20

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,041
Website

Re: Image tab - upload behaviour

gomedia wrote #324853:

Is this deliberate or am I missing something? When uploading an image I would really want to be in immediate edit mode to set alt text, caption etc. The 4.7/4.8 system forces an extra step into the process. Only when uploading multiple images does remaining on the Image List tab make sense to me.

Didn’t Oleg originally try something like that (one image -> go to edit panel, multiple images, stay in list view) ? Maybe it became to convoluted ? I could be wrong though, as it was quite a while ago.

that said, I am not sure it is a good idea, though, I suspect it might end up being confusing to the end-user.


Where is that emoji for a solar powered submarine when you need it ?

Offline

#4 2020-07-26 08:29:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,639
Website

Re: Image tab - upload behaviour

phiw13 wrote #324861:

Didn’t Oleg originally try something like that (one image -> go to edit panel, multiple images, stay in list view) ?

I’m pretty sure we did try it, and it either didn’t work reliably or…

I suspect it might end up being confusing to the end-user.

… this.


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

#5 2020-07-26 08:46:21

etc
Developer
Registered: 2010-11-11
Posts: 3,775
Website

Re: Image tab - upload behaviour

Yes, this change is related to multiple images upload. I’m sure we have discussed it and have not found a better consensus.

Plugin-terfering should be easy, but I need to check the code to recall the details. Uploaded files ids are stored in JS textpattern.Relay.data.fileid object, fwiw.

Offline

#6 2020-07-26 09:42:09

etc
Developer
Registered: 2010-11-11
Posts: 3,775
Website

Re: Image tab - upload behaviour

Here is a basic (Admin+AJAX) plugin:

script_js(<<<EOS
    textpattern.Relay.register('uploadEnd', function(event) {
        if (textpattern.Relay.data.fileid.length == 1) {
            window.location = 'index.php?event=image&step=image_edit&id='+textpattern.Relay.data.fileid[0];
        }
    });
EOS
, false, array('image'));

Offline

#7 2020-07-27 03:14:59

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,253
Website

Re: Image tab - upload behaviour

Bloke, phiw13, etc – thank you for the replies.

… it might end up being confusing to the end-user.

Don’t see why it would be, after all we were quite happy with the old behaviour … or so I thought. Maybe I’m just set in my ways.

etc – a very tasty code morsel, most satisfying, & much appreciated!

Offline

#8 2020-07-27 07:12:47

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,041
Website

Re: Image tab - upload behaviour

gomedia wrote #324882:

Bloke, phiw13, etc – thank you for the replies.

Don’t see why it would be, after all we were quite happy with the old behaviour … or so I thought. Maybe I’m just set in my ways.

it is a “now you see it, now you don’t” issue, in that you have a very different behaviour / process depending on the number of files. In the old day, you did not have that problem of course, only one file at a time was / could be uploaded.

Last edited by phiw13 (2020-07-27 07:14:00)


Where is that emoji for a solar powered submarine when you need it ?

Offline

#9 2020-07-27 13:41:49

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 975
Website

Re: Image tab - upload behaviour

Perhaps in regards to UX and expectations, is there an alternative where the editing options for a single file upload are in the upload interface itself?

Frankly, that would be even smoother and intuitive to my thinking. I click on the upload, select my file, and all the various editing options I would have in Textpattern’s edit screen are available right then and there. I set them and then click upload. I move on.

If I am doing multiple files, then upon selecting the 2nd image the editing feature goes away, or alternately perhaps it remains and allows the entire batch upload to receive the same settings.

Just thinking aloud.

edit

– and thinking further, realizing my ignorance. I had had stepped back from website stuff for a bit. Since then I’ve not done anything with images. So I’ve not used the multi-edit feature since the dev versions. Maybe what I described is how it already works these days. If so, I apologize for my ignorance.

I am still working on getting my sites up to the latest/greatest version. I had just tried updating one of my rather old installs that broke when Dreamhost upgraded their php, and in the process borked the install entirely. So I’m still a bit behind on being able to test how things are currently looking/working.

Last edited by maverick (2020-07-27 14:19:30)

Offline

#10 2020-07-27 16:16:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,639
Website

Re: Image tab - upload behaviour

maverick wrote #324907:

is there an alternative where the editing options for a single file upload are in the upload interface itself?

Only the category at present, which means you can bulk-assign the category at upload.

click on the upload, select my file, and all the various editing options I would have in Textpattern’s edit screen are available right then and there. I set them and then click upload.

If it weren’t for screen real estate restrictions, this might work. Not sure how to lay it out, but if you have ideas here, by all means share them.

If I am doing multiple files, then upon selecting the 2nd image the editing feature goes away, or alternately perhaps it remains and allows the entire batch upload to receive the same settings.

Since you can drag/drop images and files onto their upload buttons, and if you’re multi-selecting images we don’t know how many you’ve picked until you hit ‘Select’ there’s no way we can determine this as you select files. But we could do it afterwards.

Further, I’m not sure how many times you upload a bunch of images that require the same alt text and caption, but I can’t say I’ve ever done it. If I’m missing a use case, please enlighten me.

I did have a conversation (somewhere… here? … GitHub…?) with phiw13 or Kjeld about more sensible defaults when uploading images. Can’t for the life of me remember what we decided, but I think it was something to do with the creation date being read from the file’s datestamp instead of defaulting to ‘now’. Uhhh, maybe. Or reading other standard metadata (if there is any such thing?) and setting defaults to save you having to type stuff again if your images are already pre-processed in Lightroom or something.


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