Page 1 of 1

Simple Integration - Am I Missing Something?

PostPosted: Thu Jun 14, 2007 2:44 pm
by mac72
First of all, I'd like to thank the developers for making this editor. This is by far the most promising editor I have come across, and I have been searching for a while.

Anyway, I'm having a tough time integrating the editor to the point that it actually functions. I believe I'm not alone when I say that the minimal integration example (http://trac.wymeditor.org/trac/wiki/0.3/Integration) is way too minimal for an example, and there doesn't seem to be a clear description of where the input is supposed to go.

For example, if I read in the contents of a text file that I want to edit, and that text is held in a variable named $pageContent, do I simply add an echo statement inside the <textarea> tags?
Code: Select all
<textarea><?php echo $pageContent;?></textarea>

Or does that content need to be assigned to a JavaScript variable?

After that I should be fine. I can process forms and handle file reads/writes just fine.

I'm sorry if I'm missing something. I'm normally pretty clever when it comes to coding issues, but this one's had me banging my head against the wall. I figured it was time to ask for help rather than spend all day on trial-and-error techniques... I'm sure it's something simple.


Best Regards,
Mike

PostPosted: Fri Jun 15, 2007 7:23 am
by jfh
Hi, you can actually populate the textarea value with php echo. You just need to 'htmlentities' it.

Another way is to use the 'html' option (see http://trac.wymeditor.org/trac/wiki/0.3/Customization).

The 2 techniques are quite equivalent.

PostPosted: Fri Jun 15, 2007 11:14 am
by mac72
Thanks!

In this case I feel like an idiot. I had been using the 'html' option in the script if the file was blank to begin with, it just hadn't occurred to me to put my file contents there...

Everything works now and it was indeed something simple.

Thanks again, JFH, you and your team are doing most excellent work on this.


Mike