Archive

Posts Tagged ‘fckeditor’

Drupal Wysiwyg + Fckeditor : tips

May 24, 2009 10 comments

I’ve just spent the last 2 hours configuring FCKeditor for drupal.  Here are the main points:

To get the “Browse Server” button working for image uploads / quick upload / any uploading:

  1. First you’ll need to get into the config.php file fckeditor/editor/filemanager/connectors/php
    In there, I’ve added the following lines :

    $Config['Enabled'] = true ;
    // Path to user files relative to the document root.
    $root = "../../../../../../../../default/uploads/";
    $Config['UserFilesPath'] = $root ;
  2. Next I had to hack the fckeditor.inc file in /modules/wysiwyg/editors.  These settings probably have some integration with the drupal admin menu, but after a half hour of clicking all the options and things not showing up… I figured it’s easier to just get in there.  Obviously, this is not condoned… but this might be something that the wyswyg module needs to address.  You’ll need to make the following changes:
    function wysiwyg_fckeditor_settings($editor, $config, $theme) {
     $settings = array( 'EditorPath' => base_path() . $editor['library path'] .'/',
     'SkinPath' => base_path() . $editor['library path'] .'/editor/skins/'. $theme .'/',
     'Width' => '100%',
     'Height' => 420,
     'LinkBrowser' => TRUE,
     'LinkUpload' => TRUE,
     'ImageBrowser' => TRUE,
     'ImageUpload' => TRUE,
     'FlashBrowser' => TRUE,
     'FlashUpload' => TRUE,
     );
  3. Next thing, is that after all this work, FCKeditor has this great filebrowser / uploader functionality, but only images and flash files can be uploaded??? what’s the deal.  It’s not very intuitive, but it’s the “Link” button that enables you to upload more generic files like PDF’s, word files, excel files and the like.  If I couldn’t figure that out, I’m guessing that it’s not very intuitive to others either.  The easiest way to address this was to just change the tooltip in the en.js file in /fckeditor/editor/lang.  I just changed the tooltip to “Insert/Edit Links and Files”.  If you make the change to the en.js file, you will need to clear your browser cache or you won’t see the changes taking effect.
Advertisements
Categories: Uncategorized Tags: ,