Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2011-05-05 15:27:31

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

Re: Frontend editing with rich text editor

JEditable with the textile plugin looks pretty well suited to a standard txp setup. Seems to me like to implement that, you’d just have to:

  1. test whether a person is logged in, before loading the script,
  2. tie the update button to a callback to the article’s title, body, or excerpt.

Of course I suppose that’s like saying you just have to…

  1. make a time travel machine
  2. go back and create facebook in 1998

Offline

#14 2011-05-05 15:50:33

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

Re: Frontend editing with rich text editor

:-)

The first bit you can solve with rvm_if_privileged, the second bit I guess needs a custom script to write the changes back to the database. Stef made something along those lines for the “scheduler” in the example I linked to above but that was a specific situation. I’m not sure that the mem_ plugins lend themselves to this situation as you need to have a form to process.


TXP Builders – finely-crafted code, design and txp

Offline

#15 2011-05-06 06:36:35

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

Re: Frontend editing with rich text editor

mem_form aught to be able handle it, no?

Offline

#16 2011-05-06 08:58:46

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

Re: Frontend editing with rich text editor

mem_form aught to be able handle it, no?

I think mem_form would work if a window or modal box loaded containing a textarea, form and submit button built with mem_simple_form + mem_form or mem_public_article. IIRC mem_form has to process a form made with mem_form tags (if you make your own form elements not using mem_form, it ignores them) and the form processor checks against the unique “nonce” of the form. This a bit like the front end link we have at the moment, except that you load the “admin interface” in a modal box rather than another tab/window and you craft your own simplified interface with mem_form etc.

The jEditable examples all just send a few post variables (see “What is sent to the server” on that page) and you need a separate php script to take over from there and to handle securlty. That could be quite simple for normal txp:body/excerpt situations, or more complex when you want to edit custom_fields, or add new links to a link list etc. To use textile, you also need a small php script to load the textile markup source for txp:body or txp:excerpt from the db as it’s not part of the page source.


TXP Builders – finely-crafted code, design and txp

Offline

#17 2011-05-06 14:03:19

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Re: Frontend editing with rich text editor

And a simple iframe. Generated by Jquery. As bot_image_upload ?

<txp:rvm_if_privileged>
  <script type="text/javascript">
	$("body").append(
           '<div id="modal_windows">' +
           '<iframe id="write_iframe" src ="<txp:site_url />textpattern/index.php?event=article&amp;step=edit&amp;ID=<txp:article_id />" frameborder="0"></iframe>' +
           '</div>'					);
  </script>
</txp:rvm_if_privileged>

Offline

#18 2011-05-08 17:52:57

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

Re: Frontend editing with rich text editor

OK, someone smarter than me want to package all this up into a plugin?

Offline

Board footer

Powered by FluxBB