html in tinymce

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
regus
New Member
New Member
Posts: 8
Joined: Fri Jan 15, 2010 10:54 pm

html in tinymce

Post by regus »

I've developped a module which uses tinymce. In my database, I store text in html-format. For example line1line2

I want to display this html-text in a tinymce editor, but I always see the html completely, including the html-tags.

I use the function 'CreateTextArea' to display the textarea.

MyModule::CreateTextArea(true,$id,$myText,"txtMyText");
--> where $myText contains "line1line2"

I'm doing something wrong, but I don't know what...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: html in tinymce

Post by Dr.CSS »

Most likely your problem is you are calling a text area not tiny so of course your only going to get raw code...
regus
New Member
New Member
Posts: 8
Joined: Fri Jan 15, 2010 10:54 pm

Re: html in tinymce

Post by regus »

No, the textarea is indeed a tinymce (see screenshot)
Attachments
tiny.jpg
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: html in tinymce

Post by Dr.CSS »

If you look at that in raw html mode does it have the in html entities?...
regus
New Member
New Member
Posts: 8
Joined: Fri Jan 15, 2010 10:54 pm

Re: html in tinymce

Post by regus »

If I look at it in raw-mode it is the content of the editor is : line 1
line 2 And that is exactly what is stored in my database
If I switch to html-mode it is <p>line 1<br />line 2</p>

My settings are set to "raw encoding"
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: html in tinymce

Post by Dr.CSS »

The  <p>line 1<br />line 2</p>  is why when you look at it in tiny or on a page it looks like line 1
line 2  somewhere between where you put it and tiny getting it it is changed into html entities...
Post Reply

Return to “Developers Discussion”