14
Apr
2009
abhishek

G2Image in Drupal using TinyMCE with WYSIWYG API

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


Great For Galleries

Submitted by Iowa Wedding Photographers (not verified) on Fri, 11/06/2009 - 10:03.

I'm a photographer who recently switched to Drupal. I've been using Joomla and Wordpress for most of my site, but now I've discovered Drupal. I appreciate you post on galleries, I can use this to display some of my customers photos and redesign some of my sites. Thanks again!
Iowa Wedding Photographers

Thanks!

Submitted by Vps Hosting (not verified) on Wed, 10/14/2009 - 06:54.

The text that you have posted is a phenomenal and very wisely explained. Very good.

machine shop

Submitted by Sandip Saini (not verified) on Sat, 07/04/2009 - 12:56.

Wow really makes you think. I like it very much. Very inspirational and motivational. Thanks for that.

Tools

Submitted by Iscar (not verified) on Sat, 05/30/2009 - 13:24.

"The article you have posted is superb!

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

Thank you!"

Thanks a lot............!!

Submitted by articles (not verified) on Fri, 05/01/2009 - 12:34.

I would really would like to thank u for this information. I will write u again if I face some problem.

G2image plugins

Submitted by Vincent (not verified) on 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

Wysiwyg 6.x-2.0

Submitted by Markus (not verified) on Sat, 10/17/2009 - 19:10.

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?

same problem: tinymce doesn't show up

Submitted by willem (not verified) on Fri, 05/08/2009 - 17:30.

Hey Vince,

I'm also tried teh wysiwyg 6.x-2.x-dev and then there are no tinymce buttons on the screen:( with the wysiwyg 6.x-1 module this is okee, but then you dont have pagebreak working.

I lett you know when i solved this.

Willem

Added to DrupalSightings.com

Submitted by Anonymous on Tue, 04/14/2009 - 16:25.

Added to DrupalSightings.com

mediawiki?

Submitted by Marsha (not verified) on Fri, 05/28/2010 - 20:54.

interesting thoughts. Does this also come for MediaWiki? Or is it just a drupal thing? regards weekendje brugge