Hi
I am upgrading a CMS app that used FCKeditor over to CKeditor.
I was familiar with using FCK with PHP, creating a PHP object and the html for an editor instance.
This was pretty simple and described well in the developer guide ($oFCKeditor->CreateHtml();)
but I can't seem to find much detail on CKeditor PHP integration.
Am I missing something? There is more info on .Net integration.
Specifically, I'd like to find out how to create the html so I can upgrade without too much rewriting.
...stu
I am upgrading a CMS app that used FCKeditor over to CKeditor.
I was familiar with using FCK with PHP, creating a PHP object and the html for an editor instance.
This was pretty simple and described well in the developer guide ($oFCKeditor->CreateHtml();)
but I can't seem to find much detail on CKeditor PHP integration.
Am I missing something? There is more info on .Net integration.
Specifically, I'd like to find out how to create the html so I can upgrade without too much rewriting.
...stu
Re: Integrating CKeditor with PHP - CreateHtml
Re: Integrating CKeditor with PHP - CreateHtml
Hi
thanks for replying, but which example? Are you referring to the php folder in _samples directory?
I've found nothing in there that gives a lot of information apart from the basics, and not anything that seems to relate to createHtml or similar, but let me know if there is something that I've missed.
...stu
Re: Integrating CKeditor with PHP - CreateHtml
Re: Integrating CKeditor with PHP - CreateHtml
Okay
so in ckeditor_php5.php I see this at line 128
* $CKEditor->editor("field1", "<p>Initial value.</p>", $config, $events);
is this what you are directing me to?
If so, this is as per the examples in _samples, and creates an immediate instance of a textarea, whereas I would like to create dynamic html that I can then 'echo' into a template.
I have done some testing with $CKEditor->editor and $CKEditor->replace methods, but they won't work gracefully as a replacement for CreateHtml with the upgrade.
...stu
Re: Integrating CKeditor with PHP - CreateHtml
That's how it works.
Re: Integrating CKeditor with PHP - CreateHtml
Hi Datalink
- yes - thats one way of doing it. It creates the input immediately.
In FCK you could also do this:
$inputString = $oFCKeditor->CreateHtml();
This way, textarea is not yet added to the page. I can echo $inputString to the page later.
I use this when I create wysiwyg inputs dynamically on a page. An include file creates the html for one or more dynamically named textareas and passes them back to the template which positions them. This way, I can use the include file to create input fields for many pages without having to write FCK code into the template each time.
...stu
Re: Integrating CKeditor with PHP - CreateHtml
If you need exactly the same like FCK it does, you have to rewrite CKEditor class. I'm not sure whether it works correctly. Example:
rename class CKEditor to class FCKeditor
set public $InstanceName; and public $Value;
write function
Think this doesn't work, it's only an example for a rewrite.
Re: Integrating CKeditor with PHP - CreateHtml
Hi Datalink
that looks exactly like what I need - will have to try it tomorrow.
Out of interest, how did you find that? - I've searched through the documentation and there is nothing covering this as far as I can see.
Searching the forums for returnOutput I now see other people asking similar questions, but it seems strange that nothing is given officially.
...stu
Re: Integrating CKeditor with PHP - CreateHtml
Most things are easier as you think.
Re: Integrating CKeditor with PHP - CreateHtml
I wonder if the original poster got this to work? I'm also trying to convert FCK createHTML() function to CK, and returnOutput =true doesn't do what I need at all.
I generate a complete section of my page and then return it as a string to be then inserted into a div using innerHTML call - but all I ever get is a textbox.
Alyn