Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-05-04 10:20:07

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

Frontend editing with rich text editor

Hello,

a growing number of clients demand front end editing capabilities here, even with rich text editor integration (like tiny mce or similar).
Idealistically one could just login, then click on a div in the front end and start editing its content, incl. images or videos, right away.

As i would like to stick to Textpattern for its obvious code elegance i would like to ask, if there’s recent plug-ins to consider and if anyone recently made this work. (Yet i only found orphaned stuff like rsx_frontend_edit.)

I’d be glad to look at or even try out a working example if possible, otherwise any hints in this direction are very appreciated.

Thank you in advance!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#2 2011-05-04 11:40:11

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Frontend editing with rich text editor

Hello

I find that rss_article_edit works well in the client front end editing role. One has to apply the plugin tags of course but that’s not difficult. I usually guide the user through setting the required cookie to his/her browser and almost always with his/her permissions temporarily elevated. After that it’s straightforward for them.

Offline

#3 2011-05-04 11:47:00

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

Re: Frontend editing with rich text editor

Hello Joe,

thank you for this. Are you using rss_article_edit with txp 4.4.0 and does it support integration of a rich text editor like hak_tinymce or similar into the front end as well?

Thanx again.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#4 2011-05-04 12:18:16

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

Re: Frontend editing with rich text editor

Hi jane

rss_article_edit is no longer supported.

rvm_privileged provides similar functionality

The code you will need:

<txp:rvm_if_privileged><a href="<txp:site_url />textpattern/index.php?event=article&amp;step=edit&amp;ID=<txp:article_id />">EDIT</a></txp:rvm_if_privileged>

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

Offline

#5 2011-05-04 15:21:10

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Frontend editing with rich text editor

Hello Again Jane,

Yes, rss_article_edit works fine with TXP 4.40 and hak_tinymce. To be clear though, it provides a front end link in an article to the same article under the write tab in the rear end. It is used in conjunction with the “View” link in the TXP write tab to toggle to and fro. As Yiannis points out, like all the rss prefixed plugins, rss_article_edit is no longer supported. The Ruud supported rvm_privileged does provide similar functionality with the extra coding he thoughtfully provided. Both require to be wrapped in <txp:if_individual_article> tags so that the edit link only appears with an editable article. The link would take the user to a blank write tab were it to be present in a article list page like a ‘sticky’ section landing page, for instance. It will also throw the Tag error: <txp:article_id /> -> Textpattern Notice: Article tags cannot be used outside an article context notice in that situation.

So for rss_article_edit the full line of code is something like
<txp:if_individual_article><txp:rss_article_edit>Edit this article</txp:rss_article_edit></txp:if_individual_article>
and for rvm_privileged it is
<txp:if_individual_article><txp:rvm_if_privileged><a href="<txp:site_url />textpattern/index.php?event=article&amp;step=edit&amp;ID=<txp:article_id />">Edit this article</a></txp:rvm_if_privileged></txp:if_individual_article>.
I don’t generally otherwise use rvm_privileged and so tend towards the more economical rss_article_edit (posh way of announcing that I am a lazy idle person).

Joe

Last edited by joebaich (2011-05-04 15:24:58)

Offline

#6 2011-05-04 15:41:35

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

Re: Frontend editing with rich text editor

rvm_privileged is a little wordier in the setup department, but I would recommend it for the simple reason it offers more control. For example, as Joe says with rss_article_edit, once you have jumped through the (minor) hoop of setting the cookie I believe that implies your cookie-powered user can edit any article; in some cases that’s not desirable.

Ruud’s plugin (specifically the wonderful rvm_if_privileged) allows you to offer targeted edit links for articles that only the currently logged-in user has permission to edit. Otherwise it may involve frustration as the user clicks an Edit link to be transported to the admin side, where they edit the article and only then notice that the Save button is missing because they don’t have sufficient privileges.

One other nice thing to do is utilise a dashboard plugin to add content under TXP’s Home tab. So when someone first logs in they can be presented with some useful jump-off points; one of which is perhaps a link to the front-side article section which could display the articles in a grid, complete with [Edit] links to the now-privileged user as a shortcut to having to find the article they want to alter. I’ve also seen a dashboard that listed that user’s last 10 edited articles for super-fast returning to an article that was being edited in a prior session. The application largely depends on your users/data model, but some recent plugins have started to blur the line between the admin/public interfaces, which allows you to do some pretty neat stuff.

Overall I would heartily recommend rvm_privileged for the extra granularity and power it provides. But if rss_article_edit fits your needs then there’s nothing wrong with using it.

Last edited by Bloke (2011-05-04 15:44:39)


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

#7 2011-05-04 18:27:17

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

Re: Frontend editing with rich text editor

Thank you for comments and codes, Yiannis, Joe and Stef.

I had experimented with rvm_privileged before only to find it collide with other plugins (etz_pg made it stop working).
Edit buttons didn’t always show up.
Also i had managed to implement hak_tinymce into the front end (when logged in), but it was not capable of accessing the database from there. Instead it edited a browser-cached content, that was gone, when clearing cache.

All of this might be due to my limited programming capabilities.
However, if i could see working example, especially for the front end rich text editor in action, it would provide at least some hope, that those things are possible in Textpattern at all. This would save me from having to work with code wise confusing and overcharged CMS like Adobe Contribute, which clients heavily ask for and prefer their direct accessibility and wisywig editing over editing in back ends.

So, who could eventually show me that this exists already?

Thank you again in advance!

Last edited by jayrope (2011-05-04 18:28:39)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#8 2011-05-04 20:39:22

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Frontend editing with rich text editor

Hi, I’ve used both methods extensively and successfully over the past couple of years with tinyMCE.

What I’d really like to see integrated at some point is a link that creates either a lightbox style in place editor, or a method where clicking on a piece of content allows editing inline. Modx did this quite some time back.

Offline

#9 2011-05-04 20:47:37

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

Re: Frontend editing with rich text editor

Hi Dale,

inline editing is exactly, what i am looking for. Was just a lack of the right words to express that.

Is there a chance i could check out a site, where tinymce runs on the frontend, but only when logged in, like on article bodies and excerpts?


A hole turned upside down is a dome, when there’s also gravity.

Offline

#10 2011-05-05 02:33:57

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Frontend editing with rich text editor

jayrope wrote:

Is there a chance i could check out a site, where tinymce runs on the frontend, but only when logged in…

nope. What I have used just takes you inside the admin to the exact article in a new tab.

Offline

#11 2011-05-05 09:56:13

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

Re: Frontend editing with rich text editor

jayrope wrote:

inline editing is exactly, what i am looking for

Then you’ll probably need to design it yourself using one of the mem_ suite of plugins. mem_article_edit, mem_form, mem_simple_form, etc. Don’t know about a TinyMCE editor but I’m sure you’ll be able to attach it (or a suitable jQuery equivalent) to a textarea on your custom front-of-house editing form.

The mem_ plugins are incredibly powerful but they’re sometimes fiddly to set up. Worth investing some time into it though if you want true front-side editing of article content. Some folk here on the forum have done it so you can always ask specifics and someone’ll be able to help out.

Last edited by Bloke (2011-05-05 09:56:40)


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 2011-05-05 10:15:07

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: Frontend editing with rich text editor

Some folk here on the forum

Up to now we’ve only made a different front end admin interface for specific uses, but I think what you describe is “edit in place” functionality.

I imagine that would be possible with some ajax and custom-script trickery, e.g. with mem_ plugins showing in a modal box or with an edit-in-place script like jEditable or HTML5’s new contentEditable tag in combination with an own db-update php script, but as Stef says it would be an entirely custom setup you’d need to concoct from scratch. Also, if you want to edit more than the standard individual_article page, your page design would need to provide all kinds of “hooks” to tell the “edit in place” editor what it needs to replace and how.


TXP Builders – finely-crafted code, design and txp

Online

Board footer

Powered by FluxBB