Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2016-05-11 18:22:07

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: [feedback] Image upload directly in the write tab

Bloke wrote #299058:

OK, first of all: yes! Regardless of whether the remainder of your prefs patch manages to get squeezed into 4.6 before final release, I think this commit ought to be in core, as it continues the tradition of fixing containers to shield plugin authors from markup changes, as well as laying the foundations for plugins such as this one.

I’m still new to admin UI. If you, Phil and others find that’s ok re future custom fields layout, I can amend all containers, sure. I think all the rest of this branch (array prefs and dataform) could go into 4.6 too, save new core html handlers that can wait.

Offline

#14 2016-05-11 19:47:19

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

Re: [feedback] Image upload directly in the write tab

etc wrote #299062:

I think all the rest of this branch (array prefs and dataform) could go into 4.6 too, save new core html handlers that can wait.

I agree. Maybe the HTML handlers could sneak in after beta, once we nail down suitable parameter lists.


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 2016-05-12 10:17:16

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [feedback] Image upload directly in the write tab

etc wrote #299057:

I’m experimenting with FormData submit in this 4.6 branch. As a byproduct, uploading images (or files) from Write tab is a few-liner plugin. If somebody wants to test:

Hi, thanks for this experiment, it could definitly enhance the UX for Txp users.
The image preview with a link to edit it is nice.
The only thing that comes in my mind for now is that I often use multiple images id’s in the Article image field so I’d really like to be able to upload several images or add one without removing the previous. It would mean that we’d need a remove link under the preview or something like that but it is maybe not bad because we could also more explicitly display the Edit link…
I don’t know, maybe the easiest way would be to have a dedicate submission for files, independant of the article saving? ‘Do not really know but here are my thoughts.
Anyway, it’s an hopeful (heh… or is that promising the word?) experiment!


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#16 2016-05-12 10:54:09

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

Re: [feedback] Image upload directly in the write tab

NicolasGraph wrote #299069:

The only thing that comes in my mind for now is that I often use multiple images id’s… upload several images or add one without removing the previous… remove link… a dedicate submission for files, independant of the article saving?

And this is precisely the main reason why we have so far shied away from implementing any form of image management to the Write panel: there are so many different people that want so many different things, we’d end up inconveniencing a lot of folk.

Some want multiple images. Some want previews. Some want to adjust. Some want a popup to select from the existing images. Some want drag ‘n drop. Some want reordering… the list goes on.

My view is (and always had been) that our eventual implementation should be very basic. Oleg’s mods above show how easy it can be to customise, which means plugins can spring up to handle many different scenarios that override or augment the default behaviour. Each should cater to one or more of the options in the previous paragraph.


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

#17 2016-05-12 10:57:30

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: [feedback] Image upload directly in the write tab

NicolasGraph wrote #299069:

The only thing that comes in my mind for now is that I often use multiple images id’s in the Article image field so I’d really like to be able to upload several images or add one without removing the previous. It would mean that we’d need a remove link under the preview or something like that but it is maybe not bad because we could also more explicitly display the Edit link…

Thanks for the feedback, nice ideas. The aim was to allow multi-part forms uploading, to enable the use of <input type="file" /> handlers. The plugin is only for illustration, but multiple files upload in add/replace mode should be doable, will try it. Or go ahead and do it yourself, it’s a plugin. ;)

I don’t know, maybe the easiest way would be to have a dedicate submission for files, independant of the article saving?

That was already possible, not the purpose here.

Offline

#18 2016-05-12 11:27:06

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [feedback] Image upload directly in the write tab

etc wrote #299072:

Thanks for the feedback, nice ideas. The aim was to allow multi-part forms uploading, to enable the use of <input type="file" /> handlers. The plugin is only for illustration, but multiple files upload in add/replace mode should be doable, will try it. Or go ahead and do it yourself, it’s a plugin. ;)

Ok, that was my first thoughts but I’ll need to look deeper to see exactly how it works. I understand the Stef point of view and I love the way Textpattern keeps things simple so if this experiment can be easily enhance with plugins that’s great! …And you’re right, I’ll probably try to work on a plugin if the formdata go into the core.

Last edited by NicolasGraph (2016-05-12 11:27:40)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#19 2016-05-12 14:30:07

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: [feedback] Image upload directly in the write tab

Plugin updated to enable multiple files upload in add/replace mode. I leave further enhancements with image aficionados.

Offline

#20 2016-05-12 15:47:46

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [feedback] Image upload directly in the write tab

etc wrote #299076:

Plugin updated to enable multiple files upload in add/replace mode.

Incredible Oleg… :D


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#21 2016-05-13 09:05:19

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: [feedback] Image upload directly in the write tab

Simply amazing Oleg ;)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#22 2016-05-13 09:50:01

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: [feedback] Image upload directly in the write tab

Merci les gars, that was amazing to do too. I will push it to the master soon, happy plugin writing!

Offline

#23 2016-05-26 15:59:11

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: [feedback] Image upload directly in the write tab

Hi Oleg ;)

I don’t know if that is very difficult: maybe you could add the current article title as a default “alt text” to image. What about multiple images? Better it will be to have a same “alt text” for all different images than nothing at all.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#24 2016-05-26 16:36:51

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: [feedback] Image upload directly in the write tab

Pat64 wrote #299302:

maybe you could add the current article title as a default “alt text” to image. What about multiple images? Better it will be to have a same “alt text” for all different images than nothing at all.

Hi Patrick,

valid point, thanks. I have updated the code adding image name as alt (see $meta = array('alt' => $file['name']); line). Feel free to replace it with article title ('alt' => $rs['Title']) or whatever you want — I don’t know what is the most pertinent choice here.

Offline

Board footer

Powered by FluxBB