I just finished getting this working after a few problems and have a few suggestions for documentation that may help others out. I suggest the following order of steps:

1. Get Gallery installed and working correctly as a stand-alone app before attempting to install the Drupal module. You can either put the whole installation of Gallery underneath the Drupal root OR have a multi-site installation of Gallery located anywhere else on the server with a multi-site node created under the Drupal root. (In the latter instance, the Gallery codebase is somewhere else on the site, but there is a folder underneath the Drupal root for a drupal installation.) If you do the multi-site installation, check that it works correctly BEFORE trying to install the Gallery module by going to /drupal/gallery/ (or whatever directory you placed it in.)

2. Make some changes to the Gallery setup, again BEFORE trying to install the Drupal module. Pick a default theme that will fit into the middle column of your Drupal page. I think the best one is the Siriux theme since it has no left column and is very narrow, with one change I will explain shortly. Set it up so that "Item Actions" are available from both the photo and the Album pages. You'll need these links there because they won't be available in the left column.

3. The one problem with the Siriux theme is that it will force itself to whatever width you set in the theme. That by itself would not be so bad, but it adds a line to the style tag of the page to force anything with the class "content" to be that width, also. Once you embed this in Drupal, you may see items in the left column (many of which also have the class "content") suddenly exploding to the same width -- very unattractive. The solution, fortunately, is pretty simple. Look for a file in Gallery called

/gallery2/themes/siriux/templates/theme.tpl.

Copy that file to a "local" subfolder (it will end up being /gallery2/themes/siriux/templates/local/theme.tpl).

Now you can change the template (the one in the "local" subfolder) and your changes will override the main theme without any chance of being overwritten by later Gallery code changes. You are looking for a line near the top of the page that looks like:

.content {ldelim} width: {$theme.params.contentWidth}px; {rdelim}

Delete that line completely. You don't need it for the embedded page.

4. If you've made any changes to the template, go back to Gallery administration >> maintenance and select the option to "Delete template cache". This will force the system to erase any former copies of your pages from the cache. If you don't do that, you may get a page with the previous formatting even after you make your changes.

5. In Gallery administration, install and activate the Image Block module (assuming you want the image block option to be available in Drupal).

6. Now, finally, you are ready to install the Gallery module into Drupal and activate it.

7. If you don't want to make changes to the regular Siriux theme because other sites are using it, copy the whole theme folder as another folder in the themes folder and give it another name (like Drupal). Then go into Gallery maintenance to install and activate it and make it the default theme. Unless you want to try to figure out how to make the other themes useful in Drupal, just inactivate the rest of them from the administration menu in your embedded copy of Gallery. That should not have any effect on Gallery installations in other directories (I think -- not tested). Otherwise, just remove the option for users to select their own Gallery theme from that installation and force them to use the one that you know works.

Hope that helps others. Once I got past those problems it all worked like a charm, and it sure is nice looking!!

CommentFileSizeAuthor
#1 drupal_screenshot1.jpg49.16 KBdaniel-san

Comments

daniel-san’s picture

StatusFileSize
new49.16 KB

I must say that I really appreciate the clarity in the explanation Karen. Thank you.

I have a couple things to note on this concerning some errors that I am encountering upon trying to use this. Before explaining, I'm using Drupal 5, not HEAD, with Gallery 2. So, that may make a difference with my experience. The Drupal experts will have to tell me.

Point #7 - Copy Siriux theme, change name and add to Theme folder
I had previously tried to do the exact same thing in my Gallery install with no luck and after reading this post tried again to confirm. After copying the folder into the Themes folder and logging back into Gallery, I went to Site Admin and clicked on Themes to go in and activate the new theme and received this error:

Fatal error: Cannot redeclare class siriuxtheme in /homepages/1/d158664622/htdocs/gallery_2/themes/dmsiriux/theme.inc on line 34

There seems to be a declaration of the Siriux theme in the theme.inc file that Gallery sees and doesn't want to duplicate the same theme again.

Also, in using the Siriux theme, which does look great with Karen's suggestions to get it to fit correctly, I also get a problem with the breadcrumb list. There seems to be two sets of breadcrumbs sitting on top of each other. I've included a screenshot. I seem to remember seeing someone posting a similar problem, so I will search and try to solve the issue and give an update.

Hopefully this will be useful to anyone else who's experiencing the same problems. Thanks for the work you're doing Karen. It's greatly appreciated.

Dan

markymarknz1’s picture

I have the same problem as Dan.
Does anyone know how to fix this?

profix898’s picture

After you made a copy of the theme folder, you will have to rename all occurences of SiriusTheme (and similar strings as $this->setId('siriux');) with a new theme name (e.g. Drupal).

daniel-san’s picture

I am following up so that this may help anyone else who runs into this problem. This is to help with the double breadcrumbs that occur when you embed Gallery into Drupal and use the Siriux theme.

I did a search and some one else had posted this suggestion and I have used it successfully:

Go to the gallery-themes-siriux and open the theme.css file and add the following:

/* Sirius: Do not display the breadcrumb */
#gallery div.breadcrumb {
display: none;
}

/* Sirius: Removes the Gallery Title (as Drupal displays it)*/
#gallery h2 {
display: none;
}

I apologize for not updating sooner. This works on Drupal 5.2 with Gallery 2.2.2 on php4.

Dan

jayp01’s picture

In my opinion, a far better way is to just edit the breadcrumb and titles out of the siriux theme itself, rather than trying to hide them in the css.

Whether you create your own copy of the siriux theme as described in the comment #3 above, or create the /themes/siriux/templates/local/ subdirectory described in the original post, you'll want to edit the following .tpl files.

In the theme.tpl file, remove the following code to remove the breadcrumb:

	<div class="breadcrumb">
	  {g->block type="core.BreadCrumb" skipRoot=true separator="/"}
	</div>

Then look in album.tpl and photo.tpl and remove the line that prints the title wrapped in h2 tags.