Home > Uncategorized > Drupal Wysiwyg + Fckeditor : tips

Drupal Wysiwyg + Fckeditor : tips

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.
About these ads
Categories: Uncategorized Tags: ,
  1. May 24, 2009 at 8:55 pm

    All that hacking isn’t necessary if you use the WYSIWYG API module, IMCE and the IMCE WYSIWYG API Bridge module as detailed here. http://learnbythedrop.com/drop/129#comment-586

    • May 24, 2009 at 10:39 pm

      Thanks Rob. I did hook up the IMCE tool. I felt that the fck filemanager tool was a little more solid and intuitive. I realize that it’s not as integrated with drupal as IMCE. Would be good to skin the IMCE browser a little nicer. Have you seen the way SilverStripe handled this? It’s pretty slick. I’ve also used the MCImage Manager – also very pretty.

  2. June 1, 2009 at 10:09 pm

    In some cases the straightforward FCK browser is the perfect tool for the task. Thank you so much for this posting. I was banging my head against the wall for hours. #2 above eased my pain.

  3. Ardhian Satrya
    July 24, 2009 at 4:16 pm

    Hi,
    I have a problem with this. I’ve followed your step. But I still get this when I tried to upload a file :

    This file uploader is disabled. Please check the “editor/filemanager/connectors/php/config.php” file

    But I’ve changed the config.php accordingly to your step #1. Any idea? Thanks a lot!

  4. Juss
    August 6, 2009 at 3:19 pm

    Great post! :D

  5. August 11, 2009 at 7:20 am

    Hi techdad,

    Cool tips.

    I had just been in same scenario I mean I wanted file uploading functionality enabled in drupal->wyswyg->fckeditor and I did that using the way that you show…

    Thanks a lot

    Web-Farmer
    @letsnurture.com

  6. citonex
    November 5, 2009 at 10:05 am

    i spend many time for this problem and finally i have resolved it

    thanks, good job!

  7. stipko
    February 26, 2010 at 10:21 am

    it works! The only thing that I made different is I change
    $root = “../../../../../../../../default/uploads/”;
    TO
    $root = “/sites/default/files/fck/”;

    thank you :-)
    And I don’t have nothing against “hack” of this type. This is almost conventions ^-^ FCKEditor server browser i just fine.

  8. raspi
    March 17, 2010 at 1:16 pm

    I’ve enabled the browse function in my Drupal > FCKeditor thanks to your explanation!
    Thanks a lot.

    R.

  9. Shafiq
    March 29, 2010 at 5:01 pm

    You are a life saver man! Digging on it for 3 days. Now it works.

    For others:
    There is a integration module called imce_wysiwyg, but problem is that, when you enable that, “paste from word” button will work no more.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: