hi i am using fckeditor in my website, however the problem is that when i would like to edit the content and i try to load the contents of the field into fckeditor i get html code instead of the formatted article. any help about this? thanks
A 20 second search and I stumbled across this: http://wiki.moxiecode.com/index.php/TinyMCE:Functions
tinyMCE.setContent( html ) is what you're looking for.
Actually i made a mistake the error ergards fckeditor and not tinymce, was my oversight as im using tinymce on another project.
http://wiki.fckeditor.net/Developer%27s_Guide/Javascript_API
take a look at the insertHTML() method.
right now i have this code
<?php $oFCKeditor = new FCKeditor('articletext'); $oFCKeditor->BasePath = 'FCKeditor/'; $oFCKeditor->Value = $articletext; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '300' ; $oFCKeditor->Create(); ?>
I am unsure where to put that javascript, I thought maybe there was some parameter i could pass that would signal to the object to output html
ahh i thought you were doing this in the JS API, not PHP. I've never worked with the editor's API, but I would try changing the value line to this
$oFCKeditor->Value = '<h1>This is my HTML</h1>';
Does this treat that as text, or HTML?
yeah that is treated as html, however the variable name is displayed only instead of fetching the field contents from the database.
So where is $articletext being set? Do you have any code to pull data from the database, and set the value of $articletext?