Forum

HomeHomeCoreCoreSamples and oth...Samples and oth...OWS - TEXT EDITOR EXAMPLEOWS - TEXT EDITOR EXAMPLE
Previous
 
Next
New Post
7/31/2009 3:57 PM
 

I have made up an example to show everyone how to use the text editor in your ows modules.

Download the attached example below

(TESTED WITH - OWS 2.1.13, DNN 5.1.1, WIN 2003, SQL 2008)

 

FYI: Here are the basic steps you need to complete to get the text editor working properly:

STEP 1 Modify your "Add" form

Change your text input box from:

to a text editor:

{TEXTEDITOR,frmDescription,frmDescriptionTemp,Form,100%,400}

STEP 2 Modify your "Add" form button

You will need to add some code so that the text editor remembers your variable.

Add this code to the start of your button:

document.getElementById('frmDescription').value=FCKeditorAPI.GetInstance('frmDescription').GetXHTML(true);

so your button looks like:

STEP 3 Modify your "Save" variable

Modify your save variable so it looks like:

STEP 4 Modify your "Edit" form

Change your text input box from:

to a text editor:

{TEXTEDITOR,frmDescription[ID],"\[Description\]",text,600,300}

STEP 5 Modify your "Edit" form button

You will need to add some code so that the text editor remembers your variable.

Add this code to the start of your button:

document.getElementById('frmDescription[ID]').value=FCKeditorAPI.GetInstance('frmDescription[ID]').GetXHTML(true);

so your button looks like:

STEP 6 Modify your "Update" variable

Modify your save variable so it looks like:

Hopefully this will help everone out :)

R2I / Kevin: Can we please pin this thread for future reference?

 MWD.OWS.FaqV1.txt
New Post
1/12/2010 7:59 AM
 

Thank you for this useful post!

New Post
1/28/2010 5:23 PM
 

The only way I have been able to get this to work properly is the uncheck Escape HTML Symbols.

Is that an oversight in the example or are we supposed to leave that checked?

New Post
1/29/2010 7:52 PM
 

The problem there is that is varies based on the version of DNN. Older versions of DNN (older as in up to 6 months ago) the FCKEditor would return NON HTML ENCODED content. After that point, it suddenly started returning HTML ENCODED content. Meaning that if you encoded the result, it was now double encoded. It's been a royal pain, and im not entirely certain which version of the rich text editor provider was released where that was suddenly approved as a backwards compatible change (which obviously it was not). As you can tell, it is a bit of a pain point for me personally! :)

Anyway - to sum it up - it really depends on your environment,. Rule of thumbs is, unfortunatly - if its checked, and you get content that appears to be encoded already in the DB that is now double encoded - you'll have to uncheck it...


Kevin M Schreiner
R2Integrated / Open Web Studio
New Post
1/29/2010 8:25 PM
 

I have also found it hard in the past to get my head around this issue ;)

Thanks for the clarification Kevin.

Previous
 
Next
HomeHomeCoreCoreSamples and oth...Samples and oth...OWS - TEXT EDITOR EXAMPLEOWS - TEXT EDITOR EXAMPLE


 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share