Hi,
I've had a search on the forums, and wasn't able to find an answer to this but I wondered if anyone can shed any light on how I might achieve this.
I am making a CMS driven website, using PHP with a MySQL backend. The content for my will be pulled from the database, here is an example of the content;
What I need to do here is replace this with an instance of the FCKEditor, with "My Content" set as it's value.
I'm currently using regex to match the various elements in the page content, i'm now going to try and split this in to two parts, Pre-FCK and Post-FCK, echo the Pre, then create an FCK editor window and then echo the Post. Fingers crossed, but i'm not that confident it'll work!
I've had a search on the forums, and wasn't able to find an answer to this but I wondered if anyone can shed any light on how I might achieve this.
I am making a CMS driven website, using PHP with a MySQL backend. The content for my will be pulled from the database, here is an example of the content;
<div class='editable' id='leftCol'>My Content</div>
What I need to do here is replace this with an instance of the FCKEditor, with "My Content" set as it's value.
I'm currently using regex to match the various elements in the page content, i'm now going to try and split this in to two parts, Pre-FCK and Post-FCK, echo the Pre, then create an FCK editor window and then echo the Post. Fingers crossed, but i'm not that confident it'll work!

Re: Replacing <div> tag with FCKEditor (PHP)
It would by something like this:
function GetEditorHTML( $id, $divContents ) { $oFCKeditor = new FCKeditor( $id ) ; $oFCKeditor->BasePath = '/fckeditor/' ; $oFCKeditor->Value = $divContents ; $oFCKeditor->CreateHtml() ; }Note that you need to generate a new $id for each editor instance.
I didn't test it, but I think it should work.
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn