Log in or register to post comments
Last post
CKFinder multiple instances on page with own configuration
Hello.
I would like to know if it is possible to create multiple instances of CKEditor for PHP (with CKFinder) on the same page with different configuration (such as maximum image size or uploads directory). If it is possible - how can I load different configuration files or options? It would be great to see some code examples.
Re: CKFinder multiple instances on page with own configurati
Assign a different ID depending on which configuration option you'd like to use and then based on that ID, adjust your server side configuration. See a similar post: viewtopic.php?t=18575

Check also: config.id
http://docs.cksource.com/ckfinder_2.x_a ... g.html#.id

From the documentation:
Id - Used to identify the CKFinder object, optional. If set, the "Id" variable will be passed to the server connector on each request. When "RememberLastFolder" is enabled and the "Id" is set, CKFinder will remember the last directory in a separate cookie.

Wiktor Walc
CTO
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+

Re: CKFinder multiple instances on page with own configurati
When CKFinder is a part of CKEditor `id` parameter is not passing to the server. Here is my code:
$CKEditor = new CKEditor();
$CKFinder = new CKFinder();
$CKEditor->basePath = '/ckeditor/' ;
$CKFinder->Id='short';
$CKFinder->SetupCKEditor($CKEditor);

GET data at server:
command = GetFolders
currentFolder = /
hash = c27522cd82031356
langCode = en
type = Files


Id patameter is passing normally when CKFInder is standalone only:

$CKFinder = new CKFinder();
$CKFinder->Id='short';
$CKFinder->Create();

GET data at server:
command = GetFolders
currentFolder = /
hash = c27522cd82031356
id = short
langCode = en
type = Files


How to pass CKFinder application id when I'm using It together with CKEditor?
Re: CKFinder multiple instances on page with own configurati
To connect CKFinder with CKEditor and pass the ID to the connector, you must change the way how you integrate both applications.

Pass additional file browser configuration settings to the config property of the CKEditor instance, including your custom id in the query string:
http://docs.cksource.com/CKFinder_2.x/D ... ntegration

In short, do something more or less like this:

var editor = CKEDITOR.replace( 'editor1', {
   filebrowserBrowseUrl: '/ckfinder/ckfinder.html?id=foobar'
} );

Wiktor Walc
CTO
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+