Click to See Complete Forum and Search --> : tinymce problems
drtanz
05-23-2007, 10:39 PM
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
cgraz
05-23-2007, 11:49 PM
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.
drtanz
05-24-2007, 05:40 AM
Actually i made a mistake the error ergards fckeditor and not tinymce, was my oversight as im using tinymce on another project.
cgraz
05-24-2007, 05:43 AM
http://wiki.fckeditor.net/Developer%27s_Guide/Javascript_API
take a look at the insertHTML() method.
drtanz
05-24-2007, 05:48 AM
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
cgraz
05-24-2007, 06:00 AM
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?
drtanz
05-24-2007, 06:18 AM
yeah that is treated as html, however the variable name is displayed only instead of fetching the field contents from the database.
cgraz
05-24-2007, 05:58 PM
So where is $articletext being set? Do you have any code to pull data from the database, and set the value of $articletext?
PHP Builder
Copyright Internet.com Inc. All Rights Reserved.