proper setup - Drupal5.x multisite and Gallery2.2.3 multisite

Gintas

Joined: 2005-03-30
Posts: 9
Posted: Thu, 2007-10-25 17:07

I read following sentence:
"Extract the Menalto Gallery into a folder called "gallery2" inside your Drupal installation (we recommend drupal/modules/gallery/gallery2 to avoid location issues)"
in this web page:
http://community.contractwebdevelopment.com/installing-gallery2-in-drupal

I wonder if this "location issue" really exists and I will have problems if I installed my Drupal and Gallery codebases on the same level in file system. Next to each other:
/docroot/gallery2/
/docroot/drupal/

and then I have multisite installation of gallery for each multisite instance of Drupal:

/docroot/drupal/sites/www.mysite1.org/gallery2/
/docroot/drupal/sites/www.mysite2.org/gallery2/
etc.

Drupal gallery module is here:

/docroot/drupal/sites/all/modules/gallery/

First I followed suggestion in the site above and uploaded Gallery2 codebase into this directory inside gallery module:
/docroot/drupal/sites/all/modules/gallery/gallery2/
But then I switched by simply changing one line in multisite gallery config file to point to Gallery2 codebase installation outside rather then inside Drupal and everything still works fine. I still haven't removed copy of Gallery2 from inside Drupal, just in case.

It seems to me that both cases work fine unless I don't know something yet and problems or "location issues" as they say it will start happening later.

I do prefer to keep both Drupal and Gallery2 next to each other rather then Gallery2 inside of Drupal. This is mainly for organizational purposes since in some cases I will be running Gallery2 multisite instances as standalone installations instead of integrating with Drupal, or I might integrate it with other CMS such as Joomla or Mambo.

Please enlighten me if you know about these possible "location issues". Thank you.

Gintas

 
profix898

Joined: 2005-11-08
Posts: 135
Posted: Thu, 2007-10-25 19:23

We are talking about two different things here and I guess the author of the above tutorial wasnt aware of that.

In fact its quite unusual to place the G2 codebase in 'drupal/modules/gallery/gallery2/' (I dont think you will find anything like this in the official docs) and its a personal recommendation of the author, but its not wrong either. I usually recommend 'drupal/gallery2/' for this. However you can place G2 anywhere you like except in 'drupal/gallery/' because this indeed conflicts with the Drupal gallery module path.

You can even place G2 outside the Drupal root directory and it should still work. The reason why we recommend to keep G2 inside the Drupal dir has nothing to do with conflicting paths, but with some limitation of the Drupal API.

  • The drupal_add_js/css() functions do not support external paths. But without these functions you cant preserve a certain order of js/css includes in your page. This is important for some purposes, i.e. lightbox integration, jquery usage, ...
  • It was a requirement in previous version of gallery module and will likely be a requirement again for some advanced features in future versions. It simply makes thing easier to handle in some situations (or even allows certain features to be implemented at all).

In the end its your choice, but I'd suggest that you simply create a symlink in your Drupal dir (e.g. 'gallery2') pointing to the actual location of your G2 codebase. This way you only have to maintain a single codebase and the gallery module is happy to access G2 files inside its 'home' directory.

---
One more little note on the tutorial, setting .htaccess' permission mask to 0555 can be pretty dangerous (especially on a shared hosting environment), because it means that even the owner will be unable to modify the file in the future.