views:

187

answers:

2

When first searching the web for a simple CakePHP way to convert small news posts (written by a non-technician) I found the flay method in TextHelper. However it turned out that it has been deprecated, referencing to TextileHelper w/ SmartyPants.

Textile indeed seems to be a very competent markup language. Nevertheless, I'm afraid it is to complicated for the non-technical writer. All he want is to be able to write paragraphs separated by double new-line and hyperlinks inserted just as they are.

Is there a simple and non-bloated way to achieve that with CakePHP?

A: 

I think you could create your own markup set if it will only have several members. Handling those marks is easily, you just need to replace them using regular expressions after submit.

Another solution is to add a JavaSctipt WYSIWYG to your site. Something like TinyMCE could make editing even less painful.

RaYell
Thanks, this is a good suggestion. However, I would have liked to see a solution which does not involve to much manual work.
joelpet
+1  A: 

Languages like Textile or Markdown (used on stackoverflow, for instance) are great for people that are used to editing text in "plain mode", and have a bit of technical-background, I think...

But for "real normal people" that don't understand that much about computers, those are not really user-friendly, nor fault-tolerant :-( -- and are too far away from MS Word ^^
Even I, who understand why those languages are used, and how they work, often have to edit my posts on SO because of errors like "not inserting an empty line at the right place to get this or that recognized :-(

A nice solution for your users would be to use some kind of WYSIWYG editor, so they could type in their text, use some little MS Word-looking icons to format it, and all that.

Common examples of those are

  • TinyMCE (this link points to the "simple demo" page, which might be just what your users need)
  • FCKeditor

They are not that hard to integrate in an existing application, and can really make your backoffice more user-friendly !
And, depending on the use editing text, you might activate more or less options, to best fit their needs.

But there are lots of others ;-)


It would imply that you store HTML text in your DB ; and, for security reasons, you might want to sanitize it using something like HTMLPurifier.

Pascal MARTIN
Thanks! I'll probably try something like this out, even though it might be a little bit over-kill for my purposes.
joelpet
You're welcome :-) It might seem a bit overkill at first, but if you configure it to just show the icons your users need (and not more, so they are not lost in 4 lines of icons :-D ), I think they'll come to like WYSIWYG ;-)
Pascal MARTIN