Hi Stella!
Since you wrote that you had not have a Gallery2 test env. up and running I will continue to do some tests on the integration between Lightbox2 and Gallery2 (G2) if you don't mind.
This is the same testserver we used to track down the js error http://drupal.org/node/254224 and still have the patches installed:
Not sure if there something I do wrong but I:
Enabled Lightbox G2 filter, but how do I use it? The only doc on this I can find is:
Input-filter: "Lightbox G2 filter - Turns g2_filter links into Lightbox2 appropriate links"
I have created a testnode, but no lightbox.
This is the HTML from my example node:
Ligtbox 2 integration test:
Link with Lightbox2 enabled: <a rel="lightbox" href="http://drupal5.tbsk.no/index.php?q=gallery&g2_itemId=20">Link to Gallery2 picture</a>.
Same link Lightbox2 disabled: <a href="http://drupal5.tbsk.no/index.php?q=gallery&g2_itemId=20">Link to Gallery2 picture</a>.
Link with Lightbox2 enabled: <a rel="lightbox" href="http://drupal5.tbsk.no/index.php?q=gallery&g2_itemId=49">Link to image album</a>.
Same link with Lightbox2 disabled: <a href="http://drupal5.tbsk.no/index.php?q=gallery&g2_itemId=49">Link to image album</a>.
Looking into lightbox2.modules I find:
if ($delta == 1) {
$text = ' '. $text .' ';
$text = preg_replace('/ShowItem/', 'DownloadItem', $text);
$text = preg_replace('/target=""/', 'rel="lightbox"', $text);
$text = substr($text, 1, -1);
}
Looking at the search and replace I can't see how this can work? If you like I can give you access to this test site.
--
Cheers
Stein Magne
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | lightbox2_5x_257711.patch | 780 bytes | stella |
| #3 | lightbox2_6x_257711.patch | 780 bytes | stella |
Comments
Comment #1
stella commentedThe lightbox2 g2 filter is meant to be used in conjunction with the g2_filter module/option that is distributed with the gallery module. It allows you to create links to gallery images by using something like:
[G2:123], where 123 is the image number. The link it creates should contain "ShowItem" as used in the preg_replace() you mentioned, which should be replaced with "DownloadItem" when the lightbox2 g2_filter is enabled. At least this was the way it worked on my old server. There may have been updates to the module since, so this may have changed.If you're happy to give me access to your test site (my contact form is enabled), I can certainly take a look and see if I can get it working. Otherwise give me a week and I'll try to get gallery2 integrated on my new server this weekend.
Cheers,
Stella
Comment #2
steinmb commentedAHA :)
I have enabled the G2 filter from the Gallery2 module. I made sure the order is Gallery2 input filter and the G2 filter from Lightbox2, is the the correct order?
If I now load the testnode G2 [G2:123] filter is working (except linking to album Id). Lightbox2 should then search and replace, and I think the first search and replace is working inserting "DownloadItem" into the URL, but it fails to find target="" that is used to insert rel="lightbox".
I'll give you the needed access to my test site.
--
Cheers
Stein Magne
Comment #3
stella commentedThanks steinmb. Try the attached patch for the g2_filter issue.
Cheers,
Stella
Comment #4
stella commentedActually try out the next dev release of the module - available later today (probably in 1-2hrs time). With the new dev version, you will be able to click on the gallery thumbnails in your sidebar to open them in a lightbox. Also, when viewing an image page and where you can click on the image to view a larger version of it, it will also open in a lightbox.
If you don't want to use g2_filter and wish to create lightbox2 image links, then they need to look like this:
They are a bit long though, but there's nothing I can do about that.
I've added these to your test page.
Cheers,
Stella
Comment #5
steinmb commentedHave rolled the latest dev-snapshot now and it is ready to be tested. This what I have tested:
- G2 links now work again, great work!
- Clicking on the G2 link opened Lightbox but was only showing the thumbnail. I went to admin/settings/gallery/g2image and changed "Default Display Options:" to "Thumbnail with title and filname". Now lightbox open images correctly. I changed the setting back but was not able to reproduce the issue :-/
- Stepping through G2 albums with lightbox works just fine, but when you reach the end of the album the nav-arrow correctly get removed but if you click at the placeholder for the arrow lightbox closes. Is this correct? I believe that only cliking on the close button or "image ditails link" should close lightbox
- Image grid block and image block support is working.
- Navigating in G2 album with sub-albums dos not work correctly. You get easily lost. Try clicking on "Linking to image Id=175" I indicate that the image is 6 of 6, but it is the only image in this album. I placed the image in http://drupal5.tbsk.no/gallery. If you open it directly from here I think it works more correctly.
- Lightbox now open images when you navigate directly in http://drupal5.tbsk.no/gallery is this correct? I think not, but all we need is a ability to turn on on this behavior based on your needs and setup. This really simplify integration between Lightbox and G2 :)
I have not yet had time to test captions.
Cheers
Stein Magne
Comment #6
stella commentedThis is expected behaviour. You can close the image by clicking any where on the screen (except when hover navigation links or zoom links are there) or by pressing the keys "x", "c" or ESC.
This is kinda expected behaviour. The lightbox2 module has no way of knowing about albums or how many other images might be in an album. All lightbox2 knows about are the images on the current page. This is expected behaviour. However I do agree that there is a problem with the image grouping - images in blocks should not be grouped with images from the content or images from other blocks, so I've modified the js file.
Lightbox2 should not open images which are links to albums in the lightbox (e.g. http://drupal5.tbsk.no/gallery) but should open images within the album (e.g. http://drupal5.tbsk.no/index.php?q=gallery&g2_itemId=49). I've modified the js file, so hopefully this will now work.
To get the updated file, you can either download the latest dev release (available in about 2hrs time) or grab the updated file from here - just put it in the lightbox2/js directory.
Cheers,
Stella
Comment #7
steinmb commentedauto_image_handling.js is now updated, image grouping is now working better.
One thing that changed is the URL to albums. Check out e.g. http://drupal5.tbsk.no/gallery. Prev. the URL was only contained "g2_itemId=123. No it is much longer and look like (eg. g2_view=core.DownloadItem&g2_itemId=20&g2_serialNumber=2&g2_GALLERYSID=123)
Lightbox will then try to open the thumbnail album and makes it impossible to navigate into a subalbum.
Comment #8
stella commentedD'oh, ok try the updated file from here.
Cheers,
Stella
Comment #9
steinmb commentedYesss! That's "perfect" :) I think it is now working more like we want it too. I have spend 15min and done some quick tests and so far I like what I see. Pls. feel free to run more test and changes to the current settings.
One question, will clean URL provide any problem to this module? On this test server clean URL is disabled on both Gallery2 and the Gallery module. When/if you do your own Gallery2 installation, pls be aware of that clean URL can be a bit difficult, so if you run into problems it is in 90% on the cases related to clean url related, so when in doubt turn it of and try getting it to work when you know that everything else is working.
Cheers
Stein Magne
Comment #10
stella commentedClean urls shouldn't cause any problems with lightbox2. On my own sites I always have clean urls enabled. Thanks for the tip on the clean url problems with gallery2. Hopefully I'll have a chance to play around with it this weekend.
Those lightbox2 changes will be included in the next release, which I'm hoping to do this weekend or early next week. Thanks for your help with this.
Cheers,
Stella
Comment #11
stella commentedReleased in Lightbox2 5.x-2.7 and 6.x-1.7.
Cheers,
Stella
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.