Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi All
I've run across a problem with a gallery which is currently here: http://web1.jesus.ox.ac.uk/about/gallery
The images on the first page "expand" perfectly. On the second page, however, the images "expand" to their corresponding images on the first page (so, for example, the first image on the second page expands to become the first image on the first page).
I'm using Lightbox triggers to display the captions, which might be the problem (is the wrong argument being passed to Lightbox?) but the HTML looks right. Could anyone enlighten me?
blue skies
Tom
Comments
Comment #1
jeeba CreditAttribution: jeeba commentedHey i have the same exact problem in this web amarilysfloreria.com, the first page in the views expand ok , but if we go to the second page, the data expand images and info like the position in the first page. I think this have something to do with the tokens being cached. Im trying to put this code in the header of the view token_get_values('global', NULL, TRUE);, but i cant find where to configure the Php filter. Any Ideas
Comment #2
jeeba CreditAttribution: jeeba commentedFound the answer after 4 hours of debuging, the problem is in lightbox2. The problem is that Lightbox2 is not creating the adecuate path to your view when it use paging. To correct the error go to the file lightbox2_handler_field_lightbox2.inc , and in the line 124 you should see something like this:
Change that like this:
If GET has a page variable then add it to the path, and problem solved,I dont know if this is going to give me some headache in the future but so far it works like wonders.
Comment #3
stella CreditAttribution: stella commentedI don't fully understand the problem here. I've created a simple image gallery view on my sandbox, with paging enabled. Each of the images is a different size, and the lightbox resizes correctly regardless of which page of the view I'm on.
Comment #4
crispinbailey CreditAttribution: crispinbailey commented@stella,
The problem has nothing to do with image size. The problem is that if, for example, you have a large gallery (100+ images) using the Lightbox Trigger technique (so that you can display a caption), and in the View you assign a pager (so that only 20 images display per page), if/when you click on a thumbnail on page-2, the lightbox displays the wrong image because it is counting from page-1. I have been struggling with this thinking it was related to Grouping (as per http://drupal.org/node/770718) but it's not actually a grouping issue, it's a pagination issue.
Comment #5
crispinbailey CreditAttribution: crispinbailey commented@jeeba
I LOVE YOU!!! THANK YOU!!!!!!!!!!!
Your hack fixes both the pagination and the grouping issue as described in http://drupal.org/node/770718.
Hale-frikken-lujah!!!
Comment #6
shawngoldw CreditAttribution: shawngoldw commentedI am using lightbox2 version 6.x-1.9
I can not find the file lightbox2_handler_field_lightbox2.inc
Could somebody point me towards it?
Thanks,
Shawn
Comment #7
sjbwille CreditAttribution: sjbwille commented@shawngoldw: I think you have to use the 6.x-dev version for the file (and the trigger-functionality) to be there.
But I'd like to add that the problem described in this issue isn't just when using pager-functionality but also when using other filters. I suspect it's because the handler doesn't check for other values in the $_GET-global than the 'q'-key. Jeeba's solution solves the problem by extracting the value of the page-key in the $_GET-global.
Following code seems to solve all problems (pagination as well as filters).
I'm not entirely sure this works in all situation (or is Drupal-proofed), so more testing by other people would be great!
It would be awesome if this issue could be resolved in an upcoming release, since the trigger-field is an amazing tool.
Comment #8
apes132 CreditAttribution: apes132 commentedjeeba's code seemed to have worked for me. thanks!
Comment #9
goldlilys CreditAttribution: goldlilys commentedYes, jeeba's code worked for me too. Will this be added permanently to the next lightbox version?
Comment #10
timaholt CreditAttribution: timaholt commentedAnyone have any luck getting this to work with exposed date filters? Jeeba's code works for the pagers, but sjbwille's code is giving me a problem since the exposed filter i'm dealing with is a date cck field, and so the $value is an array itself. I'm trying to figure out how to pass ['date_filter_1']['value'] through the url correctly with no luck so far...
Comment #11
timaholt CreditAttribution: timaholt commentedJust as a followup, i found a working solution in my particular case, that works with both page and a specific filter (in lightbox2_handler_field_lightbox2.inc on line 124). My exposed filter was a date field, which is an array in itself. In this case i was just passing the year in but you could easily add the month/day/time values to this as well:
Also it's probably best practice to use the 'query' attribute in the url command, since with jeeba's original code you couldn't pass more than one argument through. This should help someone in a pinch, but ultimately it would be best to be able to write something that would work for any exposed filter, regardless of how deep the array goes. Thanks for pointing me in the right direction!
Comment #12
akay CreditAttribution: akay commentedAfter more than a year in the queue, this issue is still present.
A use case where it pops up is when using lightbox in a view. Create a view that displays 4 images with a pager. Give the view a pool of > 4 images to display, then when viewing the output, hover over any image greater than image number 4. You will notice that the link is '/view/name #lightbox-popup-5', and that the wrong image will pop open when clicked. When you apply the fix suggested by jeeba, the url seen in the browser is '/view/name?page=1 #lightbox-popup-5' and displays the correct image.
Comment #13
SchwebDesign CreditAttribution: SchwebDesign commentedWooow, this seems like a pretty big issue for anyone with more than one page of results using this... what a help this has been! post http://drupal.org/node/770718#comment-3050902 fixed this issue for me as well. thanks!
Comment #14
azabeti CreditAttribution: azabeti commentedThanks jeeba, worked perfectly. You saved me a lot of time and headache.
Hopefully this is fixed in D7.
Comment #15
arx-e CreditAttribution: arx-e commentedWow! #2 solved the issue I had with trigger and html content too!
# 1305462: Lightbox trigger for html content works only on the first views page
Please change the issue's title so that it contains the word "trigger" too. It seems this is an issue with trigger and pager.
Comment #16
gMaximus CreditAttribution: gMaximus commentedHi,
I've just got the right information to display at last using #7 ... #2 didn't work for me... My view has 4 exposed filters...
Now i'm getting:
I'd sincerely appreciate any help... you can see it here: http://agency.onlinebusinessbuilders.co.uk/search-entertainment-acts
Guy
Comment #17
gMaximus CreditAttribution: gMaximus commentedJust noticed this morning that using (http://drupal.org/node/770718#comment-3392314) actually breaks things on the taxonomy pages... Doh! Nothing is displayed in the pop up...
Viewable here: http://agency.onlinebusinessbuilders.co.uk/taxonomy/term/4,24
Guy
Comment #18
Caligan CreditAttribution: Caligan commentedProblem still exists - the patch in #2 solved it for me.