Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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!
Comment | File | Size | Author |
---|---|---|---|
#17 | galleria_lightbox_4.patch | 11.36 KB | eromba |
#9 | galleria_lightbox_3.patch | 6.56 KB | eromba |
#8 | galleria_lightbox2_2.patch | 6.07 KB | eromba |
#7 | galleria_lightbox2.patch | 6.18 KB | eromba |
Comments
Comment #1
Mark Theunissen CreditAttribution: Mark Theunissen commentedYou 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.
Comment #2
doomed CreditAttribution: doomed commentedTo 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.
Comment #3
shaharcoh CreditAttribution: shaharcoh commentedThank 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.
Comment #4
Mark Theunissen CreditAttribution: Mark Theunissen commentedIf you are a developer, read the Drupal 6 themeing guide. If not, you're out of luck. :<
Comment #5
shaharcoh CreditAttribution: shaharcoh commentedThank you mark, I'm not a php developer but I'll give it a go with the guide anyway.
Comment #6
Mark Theunissen CreditAttribution: Mark Theunissen commentedComment #7
eromba CreditAttribution: eromba commentedHere'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.
Comment #8
eromba CreditAttribution: eromba commentedAfter a bit more tinkering, I managed to simplify a small portion of the new JavaScript.
Comment #9
eromba CreditAttribution: eromba commentedHere's yet another update, this time with support for both Lightbox2 and jQuery Lightbox.
Comment #10
Mark Theunissen CreditAttribution: Mark Theunissen commentedThanks for the patch! I will review it soon hopefully.
Comment #11
Mark Theunissen CreditAttribution: Mark Theunissen commentedComment #12
acquixada CreditAttribution: acquixada commentedthanks 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
Comment #13
eromba CreditAttribution: eromba commented@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.
Comment #14
Mark Theunissen CreditAttribution: Mark Theunissen commentedprof1337, 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!
Comment #15
Mark Theunissen CreditAttribution: Mark Theunissen commentedSo what's next? This one or jCarousel? Up to you! ;)
Comment #16
eromba CreditAttribution: eromba commentedActually, I won't have time to update these two patches until Friday. Sorry for the delay!
Comment #17
eromba CreditAttribution: eromba commentedHere'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...
Comment #18
Mark Theunissen CreditAttribution: Mark Theunissen commentedSounds good! Will take a look soon, probably monday.
Comment #19
Mark Theunissen CreditAttribution: Mark Theunissen commentedBeen 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.
Comment #21
iCatcher CreditAttribution: iCatcher commentedWould 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!
Comment #22
iCatcher CreditAttribution: iCatcher commentedHi 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
with
Add the following lines
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
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
Comment #23
Back From 7 CreditAttribution: Back From 7 commentedThe 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.