Forum closed. New forum available at http://community.wymeditor.org/

Simple Integration - Am I Missing Something?

Support forum for WYMeditor.

Simple Integration - Am I Missing Something?

Postby mac72 on Thu Jun 14, 2007 2:44 pm

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
mac72
 
Posts: 7
Joined: Wed Jun 13, 2007 9:09 pm

Postby jfh on Fri Jun 15, 2007 7:23 am

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.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby mac72 on Fri Jun 15, 2007 11:14 am

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
mac72
 
Posts: 7
Joined: Wed Jun 13, 2007 9:09 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest