G2Image in Drupal using TinyMCE with WYSIWYG API

Submitted by abhishek on Tue, 04/14/2009 - 13:03

UPDATE: This post is quite old now and wont work with the latest version of WYSIWYG API, will try to update this soon.

Gallery2 is one of the best galleries available which could be integrated with Drupal easily you would have read my post on integrating it earlier, after you have integrated it the bigger question is how get those images into your content or nodes so this posts answers it, after reading this post you would be able to integrate Gallery2 with your WYSIWYG (TinyMCE) Editor.

Prerequisites

The Steps

  1. Extract G2 Image Application in $DRUPAL_HOME/sites/all/modules/wysiwyg/tinymce/jscripts/tiny_mce/plugins/
  2. Open Gallery Setting in Web Browser from $SITENAME/admin/settings/gallery/g2image and enable G2Image for TimyMCE as shown in the image below
    gallery settings
  3. Once you have selected the Mode as TinyMCE add the following code in %drupal%sites/all/modules/wysiwyg/editors/tinymce.inc (function wysiwyg_tinymce_plugins($editor))

    'G2Image' => array(
            'path' => $editor['library path'] .'/plugins/G2Image',
            'buttons' => array('G2Image' => t('G2Image')),
            'internal' => TRUE,
            'load' => TRUE,
             ),

  4. Now enable G2Image button for TinyMCE from the editor profile at "admin/settings/wysiwyg/profile/edit/2"
  5. Thats it select G2Image button in TinyMCE

    it will popup a Galley as shown below for you to select images and insert them directly in your posts :)

    gallery Pop Up

Vincent (not verified)

Tue, 04/28/2009 - 23:07

first thanks for your article: it help a lot to setup all the thing !

In my case I had to change:
'path' => $editor['library path'] .'/plugins/G2Image',
by
'path' => $editor['library path'] .'/plugins/g2image',

I still have an issue:
when I selected G2Image in the Button and plugins list, TinyMCE doesn't appear anymore ...

any idea?

thanks in advance

Vincent

my config:

Gallery 2.3
Drupal 6.10
modules
Gallery 6.x-1.0
Wysiwyg 6.x-2.x-dev
TinyMCE 3.2.3
g2image-v3.0.3
IMCE 6.x-1.2
IMCE Wysiwyg API bridge 6.x-1.0

Same Problem for me with Wysiwyg 6.x-2.0. If I activate the G2Image-Button, TinyMCE doesn't appear any more at all! Anyone who has solved this problem yet?

"The article you have posted is superb!

There are so many informative information. This is very knowledgeable article.

Thank you!"