Question

I can't seem to find a js RTE that will play friendly with snippets of php intertwined in it. I want a mini CMS for the backend of a number of sites. The views have some snippets of php here and there

Are there any RTE's that will leave the php alone, and even show it mixed with the nice formatting?

TinyMCE kills the tags even when entered in html mode and switched back and forth. FCKEdit seems to keep the code intact if pasted into source mode, but it isn't shown in the editing side, so if someone deletes an element with some php in it, bop, it's gone.

And none of the editors like creating nicely indented code, that would be a nice plus as well, but probably over the top to ask, heh.

Was it helpful?

Solution

The Javascript rich text editors make use of the browsers' in-built DesignMode or ContentEditable features in order to implement in-line HTML editing, and these do not support embedded PHP tags.

The solution would have to convert these to some other form, which is not going to get mushed by the browser's HTML editor, then convert them back to PHP tags upon submission.

It could be done. I don't know of any that do, however.

As for creating nicely indented code, it is a similar issue. The browsers munge it in their in-line HTML editors.

OTHER TIPS

I had a similar question a few weeks back: Textarea that can do syntax highlighting on the fly?

This may be the right thing for you: http://marijn.haverbeke.nl/codemirror/ They even have mixed PHP and HTML highlighting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top