I am creating a simple CMS for a friend. The goal is to allow them to edit their own web site with the fckeditor. I am attempting to read an html file into a variable and hand it to the fckeditor. I have confirmed that the php variable contains the full contents of the html file, yet when displayed in the fckeditor, the source lacks the HTML header. It seems to start at the first div under the body line of the file.
You can see the result at http://featheryogastudio.com/editor.php ... asses.html
Passing file=classes.html to my editor.php file should set the below $filename variable to classes.html, and the rest is up to php and fckeditor. It does pass the filename fine, and reads in most of the contents, but when you hit the fckeditor source button, it is lacking the head of the html file. This results in the css file not being imported, and the appearance of the site looking bare in fckeditor.
Any ideas? Ideally, I would like my friend to open editor.php?=somePartoftheirSite.html and see, in the fckeditor window, exactly what they would see if they had typed http://www.theirsite.com/somePartoftheirSite.html.
thanks.
<?php $filename = $_GET['file']; $file_array = file($filename); $file_contents = implode('',$file_array); $sBasePath = $_SERVER['PHP_SELF'] ; $sBasePath = '/fckeditor/'; $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = $sBasePath ; $oFCKeditor->Value = $file_contents ; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '100%' ; $oFCKeditor->Create() ; ?>
Re: fckeditor Value not reading HTML head
Setting that attribute to true will tell the editor to take its contents and treat them as a full blown HTML document. Otherwise it assumes that you're just passing a snippet of HTML and will only use whatever is inside the <body> element.
Re: fckeditor Value not reading HTML head
where do i insert this code? in config file or my editor page?
Re: fckeditor Value not reading HTML head