Hello!

I was wondering if it's possible to open the main (large) photo in lightbox. Right now the image is clickable but it's defined to go to the next photo. I was thinking of adding "rel='lightbox'" to the image tag but don't know where to change it.

Thanks in advance!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mark Theunissen’s picture

You would have to change the galleria options in galleria.js as per the following:

http://code.google.com/p/galleria/wiki/Options

Make the main image non-clickable.

Then you hook into the preprocess of Galleria in the theme layer in your template.php and add the rel=lightbox to the theme('image') call.

Sorry this isn't easier. Don't have time to code options like this at the moment.

doomed’s picture

To shaharcoh,

Even if this worked, which version would you be loading on the lightbox?

The same version shown on the clickable thumbnail or a hires one?

Because if its just the same image used on the thumbnail scaled up, it wont look good.

shaharcoh’s picture

Thank you but I need further instructions. what do you mean by "hook into the preprocess of Galleria in the theme layer in your template.php and add the rel=lightbox to the theme('image') call."? How do I do that?

To doomed: I waned the main image to show on lightbox not the thumb, any suggestion?

Thanks again guys, I appreciate your help.

Mark Theunissen’s picture

If you are a developer, read the Drupal 6 themeing guide. If not, you're out of luck. :<

shaharcoh’s picture

Thank you mark, I'm not a php developer but I'll give it a go with the guide anyway.

Mark Theunissen’s picture

Status: Active » Closed (won't fix)
eromba’s picture

Version: 6.x-1.0-beta1 » 6.x-1.x-dev
Status: Closed (won't fix) » Needs review
FileSize
6.18 KB

Here's a patch that integrates Galleria with the Lightbox2 module, allowing you to view Galleria images in a Lightbox by clicking on the currently displayed image. Simply enable the module, enable "Lightbox integration" on the Galleria admin page, and you're ready to go. You can also specify an ImageCache preset to show in the Lightbox (instead of the originally uploaded image).

Tested in IE8, Opera 9.64, Google Chrome, and Firefox 3.1 B3.

eromba’s picture

FileSize
6.07 KB

After a bit more tinkering, I managed to simplify a small portion of the new JavaScript.

eromba’s picture

FileSize
6.56 KB

Here's yet another update, this time with support for both Lightbox2 and jQuery Lightbox.

Mark Theunissen’s picture

Thanks for the patch! I will review it soon hopefully.

Mark Theunissen’s picture

Assigned: Unassigned » Mark Theunissen
acquixada’s picture

thanks for the patch, but sorry to ask: how do i use that? do i have to copy the content on some already existing galleria files?
thanks,
antonio

eromba’s picture

@antonio:

Take a look at Drupal's guide to applying patches for instructions on how to apply patches using versioning/diff software.

You can do it manually, but it is a slow process and is more prone to error.

Mark Theunissen’s picture

prof1337, thanks for all the valuable work. Great job! :)

As soon as #342708: Ability to work with CCK image field is done, could I ask you to re-roll your two outstanding patches? This one and #353642: jCarousel integration. Because I doubt they'll apply...

p.s. also, please use the -up switch for diff as per the http://drupal.org/patch/create guidelines... makes it easier to review! Thanks!

Mark Theunissen’s picture

So what's next? This one or jCarousel? Up to you! ;)

eromba’s picture

Actually, I won't have time to update these two patches until Friday. Sorry for the delay!

eromba’s picture

FileSize
11.36 KB

Here's an updated patch for the latest dev version.

I've modified the behavior of the admin form a bit: instead of displaying a status message when an integrated module isn't enabled, the equivalent message is displayed in the appropriate fieldset in place of that module's integration options. This not only makes for fewer intrusive status prompts, but also provides a quick summary of Galleria's integration features to those who are new to the module, regardless of whether or not they have the integrated modules installed. Let me know what you think...

Mark Theunissen’s picture

Sounds good! Will take a look soon, probably monday.

Mark Theunissen’s picture

Status: Needs review » Fixed

Been real busy lately, but I've now reviewed and committed. Comments:

- I like your point about the set_message, I have removed the last one from the settings page and made a generic 'help' fieldset for that message and any others in future.
- Watch out for the usage of t() function, you shouldn't ever pass HTML into it.

I definitely think there's scope for adding support for the advanced help module... but I may postpone that for now.

Thanks for the great patch! I haven't done extensive testing but it seems good.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

iCatcher’s picture

Version: 6.x-1.x-dev » 6.x-1.0

Would it be possible to create an option to remove the main image and open lightbox by clicking on the thumbnails.

I tried to follow the instructions to do that but unfortunately had no success.

Thanks in advance!

iCatcher’s picture

Hi guys,

I finally managed to get rid of the main image and open the hi-res picture with lightbox by clicking the thumbnail.

Here's my solution:

galleria.js
On line 79 replace
thumb.after('<a id="galleria_link_' + Drupal.galleria.options.num_thumbs++ + '" href="' + thumb.attr('alt') + '" rel="lightbox[galleria]" title="' + thumb.attr('title') + '"></a>');
with
thumb.wrap('<a id="galleria_link_' + Drupal.galleria.options.num_thumbs++ + '" href="' + thumb.attr('alt') + '" rel="lightbox[galleria]" title="' + thumb.attr('title') + '"></a>');

galleria.tpl.php
I've replaced the "prev" & "next" link with a link which gets me back to the album selection

galleria.css
On line 17 replace

.item-list .galleria li a {
  display:none;
}

with

.item-list .galleria li a {
  display:block;
}

Add the following lines

.galleria_container {
	display:none;	
}

Because I previously replaced the "prev/next" links with a link which gets me back to all my albums I also want to always be displayed
Remove display: none; at the very end of the file in section .galleria-nav
So the section should look like this

.galleria-nav {
  clear: both;
}

Because on my site the fade effect behaved a little bit weird now I commented the "hover effects" in the gallerie.js on line 70-74
Since all the thumbnails have set opacity now I also set the initial opacity in the galleria settings (/admin/settings/galleria) to 1.0

Now you'll only get the thumbnails which opens the hi-res image with lightbox

Back From 7’s picture

Issue summary: View changes

The new Drupal 7 version has "lightbox" option under option set module configuration. Check the box and light-boxes will now appear.

The light-box is built into Galleria.