Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-12-03 06:16:13

SuMu
Member
From: Germany - Wuppertal
Registered: 2008-03-06
Posts: 242
Website

[feedback] Image upload directly in the write tab

Hello all!

Upload the images directly in the write tab (either as a article image or just positioned left, right, center) would necessarily have to be integrated into Textpattern.

This is the biggest weakness compared to WordPress!

Is this planned?

Last edited by SuMu (2012-12-03 06:42:21)


viele Grüße
SuMu

Psychomuell + blogZicke

Offline

#2 2012-12-03 09:31:42

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

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

Yes it’s planned at some point in the future.

First we will be working on a grid display view for images, then investigating modal (popup) boxes for edit screens. If that goes well then it would hopefully be easier to integrate images into the write screen.

Offline

#3 2012-12-03 10:43:46

SuMu
Member
From: Germany - Wuppertal
Registered: 2008-03-06
Posts: 242
Website

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

Hach Thanks :-) I will wait


viele Grüße
SuMu

Psychomuell + blogZicke

Offline

#4 2013-01-18 15:14:57

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

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

philwareham wrote:

Yes it’s planned at some point in the future.

4.6?

It would/will be great feature.

Offline

#5 2013-01-18 15:37:35

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

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

gour, have you discovered bot_image_upload yet? The current, most popular, plugin solution. Used with abl_droploader, it really makes uploading images a breeze. Yes, in the Write panel.


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

Offline

#6 2013-01-18 20:22:41

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

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

uli wrote:

gour, have you discovered bot_image_upload yet?

No, not at all.

The current, most popular, plugin solution. Used with abl_droploader, it really makes uploading images a breeze. Yes, in the Write panel.

I must admit I’m a bit overwhelmed with Textpattern…it feels really great and very capable to solve all my present and future web needs, but, otoh, it is definitely a bit different from everything I’ve seen so far (I must say that Tiki is also unusual CMS which I still evaluate along with Textpattern), so I need some time to connect missing pieces to (better) understand how everything works. :-)

While being engaged with it, I just wonder if there are some projects for which it’s not recommended to use Textpattern? (FAQ says that practically everything is possible, but still wonder is something is recommended ‘no’.)

Offline

#7 2013-01-19 16:09:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,093
Website GitHub Mastodon Twitter

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

gour wrote:

While being engaged with it, I just wonder if there are some projects for which it’s not recommended to use Textpattern? (FAQ says that practically everything is possible, but still wonder is something is recommended ‘no’.)

I’m sure that txp may be inappropriate for some sites (none come to mind). From your initial post here, all can be done. As your requirements grow nevertheless, a wall will eventually appear. That’s where the plugins come in.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#8 2013-01-19 20:34:55

gour
Member
From: Hlapičina, Croatia
Registered: 2013-01-17
Posts: 124

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

colak wrote:

I’m sure that txp may be inappropriate for some sites (none come to mind). From your initial post here, all can be done.

Good…let me try to realize something.

Offline

#9 2016-05-11 13:38:36

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

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

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

# Name: abc_article_image v0.3 
# Type: Admin/AJAX plugin
# 
# Author: 
# URL: 
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

YToxMTp7czo0OiJuYW1lIjtzOjE3OiJhYmNfYXJ0aWNsZV9pbWFnZSI7czo2OiJhdXRob3Ii
O3M6MDoiIjtzOjEwOiJhdXRob3JfdXJpIjtzOjA6IiI7czo3OiJ2ZXJzaW9uIjtzOjM6IjAu
MyI7czoxMToiZGV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kpIHsNCgkJ
CSRmaWxlX2FycmF5WyRpXVska2V5XSA9ICRpc19hcnJheSA/ICRmaWxlWyRrZXldWyRpXSA6
ICRmaWxlWyRrZXldOw0KCQl9DQoJfQ0KDQoJcmV0dXJuICRmaWxlX2FycmF5Ow0KfSI7czo0
OiJ0eXBlIjtzOjE6IjQiO3M6NToib3JkZXIiO3M6MToiNSI7czo1OiJmbGFncyI7czoxOiIw
IjtzOjQ6ImhlbHAiO2I6MDtzOjM6Im1kNSI7czozMjoiMWZhNjRlMTcyNmRkOTBmNjA4YTVh
ODMzOTFkMzlhMGYiO30=

Edit: code re-updated, thanks again, Stef.

Last edited by etc (2016-09-17 09:00:05)

Offline

#10 2016-05-11 14:37:30

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

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

etc wrote #299057:

uploading images (or files) from Write tab is a few-liner plugin.

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.

That said, the plugin needs a couple of tweaks so it works for me. Firstly to fix this error:

PHP Fatal error:  Class 'txp_thumb' not found

(just need to include_once lib/class.thumb.php; for those of us that have auto thumb creation on).

Secondly, I small possible enhancement. Could you add a check for suitable privs before rendering the file browser widget? If someone doesn’t have privs to be able to upload images (or manage their own images) then they shouldn’t be able to upload them from the Write panel at all. Otherwise, I think you’d get the situation where they could select a file for upload, hit Save and find it doesn’t get saved, which is confusing UX. Might be wrong as I’ve not stepped through the code, just glanced at it so far.

Otherwise, a worthy idea. And if your commit lands in core, this plugin is a nice stop-gap solution until we can address image additions fully. Bravo!


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

#11 2016-05-11 15:41:46

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

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

Regarding your edit: ummm, think you need this line:

include_once 'lib'.DS.'class.thumb.php';

in the abc_file_save() function, since it tries to write the thumbnails inside the image_data() function.

There’s actually an argument for adding that line to the image_data() function itself in txplib_misc.php? After all, it’s a dependency in that function. What do you think?


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

#12 2016-05-11 18:11:39

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

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

Bloke wrote #299060:

Regarding your edit: ummm, think you need this line:

include_once 'lib'.DS.'class.thumb.php';...

in the abc_file_save() function, since it tries to write the thumbnails inside the image_data() function.

Oops, sorry, never used thumbnails, updated.

There’s actually an argument for adding that line to the image_data() function itself in txplib_misc.php? After all, it’s a dependency in that function. What do you think?

Well.. don’t know :)

Offline

Board footer

Powered by FluxBB