Hi, I spent a couple of days trying to get CKfinder to work with Drupal. FCKeditor was working fine, but I just couldn't get CKfinder to work, the default Filebrowser was always showing up instead of CKFinder. CKFinder would work independantly and also with the included sample files.
I found that the following lines in the fckeditor.module file was specifying whcih browser to use reguardless of what I set elsewhere in FCKeditor and CKfinder config files:
Once I changed these lines as per below, FCKeditor within Drupal now loads the CKfinder browser:
Another problem is the naming convention of directories:
FCKeditor specifies 'file' and 'image' drectories, CKfinder specifies 'files' and 'images'. The naming convention needs to be consistant over both FCKeditor and CKfinder. Probably only causes a problem if you intergrate CKfinder into FCKeditor at a later stage, not sure.
I found that the following lines in the fckeditor.module file was specifying whcih browser to use reguardless of what I set elsewhere in FCKeditor and CKfinder config files:
if ($advanced_uploads) { $element['#suffix'] .= $js_id.".Config['LinkBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Connector=".$connector_path."&ServerPath=".$files_path."'; ".$js_id.".Config['ImageBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=".$connector_path."&ServerPath=".$files_path."'; ".$js_id.".Config['FlashBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=".$connector_path."&ServerPath=".$files_path."';\n"; }
Once I changed these lines as per below, FCKeditor within Drupal now loads the CKfinder browser:
if ($advanced_uploads) { $element['#suffix'] .= $js_id.".Config['LinkBrowserURL'] = '".$module_full_path."/fckeditor/editor/ckfinder/ckfinder.html'; ".$js_id.".Config['ImageBrowserURL'] = '".$module_full_path."/fckeditor/editor/ckfinder/ckfinder.html?type=Image'; ".$js_id.".Config['FlashBrowserURL'] = '".$module_full_path."/fckeditor/editor/ckfinder/ckfinder.html?type=Flash';\n"; }
Another problem is the naming convention of directories:
FCKeditor specifies 'file' and 'image' drectories, CKfinder specifies 'files' and 'images'. The naming convention needs to be consistant over both FCKeditor and CKfinder. Probably only causes a problem if you intergrate CKfinder into FCKeditor at a later stage, not sure.
Re: FCKEditor, CKFinder and Drupal (6 - RC4)
Re: FCKEditor, CKFinder and Drupal (6 - RC4)
Before:
After:
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: FCKEditor, CKFinder and Drupal (6 - RC4)
Yeah, I had to do a search through both FCKeditor and CKfinder files (just an autosearch with Dreamweaver) and pick up the references to files and images folders, then make them all consistant (i.e. File, Image, Media, Flash) .... DON'T do an autoreplace as I'm sure that would cause problems, it doesn't take long to scan trough the list.
In wiktor's example above, I actually changed that particular code to:
Not sure if changing ALL the above references to "Image" is necessary, but I thought what-the-hay, make it consistant and it works
What wasn't mentioned in the install readme too was I had to make a "_thumbs" directory otherwise all the image previews were question marks.
Re: FCKEditor, CKFinder and Drupal (6 - RC4)
Does anyone have any ideas on how to get this working with v. 2.6.3 ? Thanks!
Re: FCKEditor, CKFinder and Drupal (6 - RC4)
Software versions used:
Step 1) You will need a working install of FCKeditor in Drupal. This is important so that you're not trying to fix bugs caused by another issue; besides, you should be at this point by now if you're reading this post... The README.txt found with the editor was accurate for installation; in my experience.
Step 2) Copy the CKFinder directory into the FCKeditor folder within the FCKeditor module for Drupal.
Step 3) In the FCKeditor Drupal module's fckeditor.module, find this:
...and replace it with this:
Step 4) Do the same as step 3 a few lines down replacing this:
...with this:
Step 5) Open config.php from within the CKfinder directory and replace the empty CheckAuthentication() function with this:
Step 6) Still within the CKfinder config.php file, set your $baseUrl path. This will need to match your FCKeditor file paths. For example:
Step 7) Clear your cache and refresh your page... You should have a working install. If not, I have been up all night trying to figure this out and forgot something. Remember having a working install of Drupal and FCKeditor with basic file upload and browsing ability first will help you avoid headaches...
Re: FCKEditor, CKFinder and Drupal (6 - RC4)
You can view a screencast on How to Install CKfinder File Browser with CKeditor in Drupal