Is it possible to configure the editor to load the contents of an htm file on startup? So, instead of passing in a string of text when I initialize the editor, I'd like to pass in a filename. Is this possible?
Thu, 02/28/2008 - 15:04
#1

Re: setting a default document
yes you can load .htm pages or .txt pages into the editor then save them back to the file when ur finish editing.

what type of language did u want this in? php, asp, ect..
heres my basic php code (i know it can be cleaned up abit, its just that i moved onto the asp after i got this working
<?php include("FCKeditor/fckeditor.php") ; // ***************************** $sValue = stripslashes( $_POST['FCKeditor1'] ) ; $action = $_REQUEST['sent']; $filename = "promotions-en.txt"; //Edit this to point to ur textfile $handle = fopen($filename, "rb"); fclose($handle); if ($action=="sent"){ $fh = fopen($filename, 'w') or die("Can't Access the file at this moment."); $stringData = $sValue; fwrite($fh, $stringData); fclose($fh); $saved = "<p>Your file has been saved</p>"; } ?> <?php echo $saved ?> <form action="<?php $_SERVER['HTTP_REFERER']; ?>" method="post"> <?php $content = file_get_contents("promotions-en.txt"); $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = 'FCKeditor/'; $oFCKeditor->Value = $content; $oFCKeditor->Width = '100%'; $oFCKeditor->Height = '490'; $oFCKeditor->Create() ; ?> <br> <input type="hidden" name="sent" id="sent" value="sent" /> <p style="text-align:center;"><input type="submit" value="Save Page"></p> </form>