ramsey_lewis
ramsey_lewis

Reputation: 598

tinymce : how to convert raw html tags?

i used tinymce to allow people to write content. But now i wan't them to edit their own content, i need to use tinymce again. My problem is in my database, this content is composed of html tags, and when i try to load the text in my tinymce textarea (in edit view), i've got the raw content eg <p> Hello my name is <em>John</em> [...] </p> . But when they written this content, it was with "wysiwyg".

I want to convert this raw html to wysiwig.

here a screenshot of the raw html

enter image description here

and i want it to be like this when they click on "edit my content" button :

enter image description here

Upvotes: 1

Views: 2152

Answers (3)

Deepak Kr
Deepak Kr

Reputation: 391

Use this:

strip_tags(stripslashes('row html content'))

Upvotes: 0

Chankey Pathak
Chankey Pathak

Reputation: 21666

tinyMCE.activeEditor.setContent('<span>html data from your database</span>');

Upvotes: 0

Ali1928
Ali1928

Reputation: 303

I use this:

echo <textarea name="icerik" id="editor1" rows="10" cols="80">'.htmlentities($satir->icerik).'</textarea>;

I use "htmlentities" method in php to convert html code to wysiwyg. When you write that converted text between and , you can get what you want.

Assuming you're using PHP of course. If not, try to search like for example "htmlentities in asp.net" or wait for another answers.

Upvotes: 1

Related Questions