Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Gallery module IE6 & 7 pagination bug


Go to End


4 Posts   3473 Views

Avatar
Jarri

Community Member, 10 Posts

25 July 2008 at 3:47am

Edited: 29/07/2008 10:44pm

Apologies for reposting this from a different thread - I just think it is worthy of a thread of it's own to give it more focus:

Has anyone got any idea how we can go about sorting out an outstanding pagination/image selection bug in the Gallery Module for ie6 and ie7. This has been mentioned on the forums a number of times and is listed on defect ticket #2440.

PROBLEM:
On any page other than the first, whichever image is chosen, lightwindow will display the last image from the previous page. This is highly disorientating for the user.

Since the Flikr extension seems to work fine in this regard, would this suggest that the problem is less likely to be in the lightwindow.js and more likely in the gallery .js? - could a solution be found by looking at the way the Flikr module handles pagination?

The effect can currently be seen on the live Silverstripe demo site. In my opinion this makes the current gallery module unfit for use for IE over multiple multiple pages - does anyone have any workarounds they could share?

I'm afraid I don't have the skills to take this on - can anyone help?

Avatar
Jarri

Community Member, 10 Posts

9 September 2008 at 12:16pm

Can anyone with a knowledge of the Gallery Module please assist? This issue even affects the official live SStripe demo site for both IE6 and IE7 (eg: http://demo.silverstripe.com/gallery/?start=84 )- making the gallery currently unusable for my project. Users cannot effectively view their chosen image in anything other than the first page. If someone could just give some ideas of how to go about debugging and fixing this I'd be glad to help in any way I can.

Also if this is really to tough to crack, could anyone suggest a workaround - perhaps not using the Gallery Module but other gallery/lightbox functionality that could be made to work- though I'd need to keep the photos on our server as opposed to Flikr etc.

Avatar
Jarri

Community Member, 10 Posts

15 September 2008 at 6:32am

Bug identified - Solved!- (well worked around!) I need a little help to test this and get a REAL solution.... one that doesn't break stuff!

Right - so first we need to look at why Flikr module works ok with IE6,7,8 and the Gallery module does not.

Looking at the generated html it shows that the Gallery module, in addition to generating a table of images to be accessed via Lightwindow for the current gallery page, ALSO produces two hidden divs (with display set to none) of links, which represent the rest of the gallerys pictures from the other pages. One set of hidden links for images prior to the current page (placed before the table) - then a second set of links for the remaining images after the current page (placed after the table). The Flikr module simply provides the links for the current page.

IE's problem appears to be that instead of feeding Lightwindow the data for the item clicked from the table it appears to grab the Last of the hidden links prior to the table element - hence the reason it appears to work fine on the first page - when the prior hidden div is empty. This behaviour seems peculiar to IE.

Ok - so knowing absolutely nothing about either Javascript, I tried the brute force method of simply removing these hidden divs from GalleryPageContent.ss (after making a security copy...!) and sure enough it solved the issue with IE - it now shows the correct image when clicked on all pages - Great!

Next thing to find out was what I'd broken... the one thing I've noticed so far is that I have broken the image "counter" eg. "image 45 of 78" - This now only gives the number of the image in the current page rather than the image number in the gallery as a whole. I am guessing that the hidden div's were a solution to this - which in turn caused their own problems. At least that's what I'm hoping cos I can live with that!

Please can someone who actually knows what they're doing take a look at this to see if this is a workable solution - or if those hidden divs had another purpose... and/or find a way to restore a proper image counting solution that doesn't break IE?

I'll add this as a proposed solution on the bug tracker - until something better turns up.

Avatar
247hosting

Community Member, 4 Posts

1 October 2008 at 9:55am

Is there any solution to this? or do we just delete the <div style="display:none"> </div> out of the file?