• Resolved Chris

    (@osiak)


    I’m using FooGallery plugin with FooBox lightbox feature. I want to show the same gallery in different places on the site depending on device size. But when I put the same gallery on the page, the first one from the top works well, but the second does not work (gallery loads, but lightbox does not work). I assume this is due to lightbox script conflict.
    Is there any smart way to go over this, besides duplicating the galleries and making a mobile version with different ID? (I’d prefer this since I have ~100 galleries across my site).

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author bradvin

    (@bradvin)

    hi @osiak

    If you put the same foogallery shortcode on the page twice, then it might cause issues due to there now being tags with duplicate id’s on the page.

    Having said that though, I have done this before without issues.

    What changes are you making to the gallery to make a “mobile version”?

    Thread Starter Chris

    (@osiak)

    Hi @bradvin,
    I actually don’t have an issue with the gallery – they display fine (I have duplicated my row and changed display settings in CSS for mobile queries). The issue is with the lightbox not working, or actually – working only for the first gallery from the top, in my case the mobile version.
    I know that such duplicate content can cause problems, especially that – like you said – the ID is duplicated and the lighbox script may reference that ID, which causes conflict with the second occurrence. Nevertheless my question is whether there might be some workaround other than duplicating all the galleries for mobile and changing the gallery IDs on the page (which will take a lot of time).

    Plugin Author bradvin

    (@bradvin)

    I think link to the page with the issue, so that we can debug the problem

    Thread Starter Chris

    (@osiak)

    Plugin Author bradvin

    (@bradvin)

    thanks for the links @osiak

    We were able to see the problem, and it is due to the duplicate ID’s on the page which is causing the issue.

    Your galleries use the rel=”lightbox[GALLERY_ID]” on the items, so what is happening is the first batch of galleries is being initialized and effectively stealing the items from the second batch of visible galleries.

    So when foobox is initialized on the second batch of visible galleries, it finds the items but they belong to another instance of FooBox so it leaves them alone.

    This is no fault of FooBox, it is doing what it is told, but getting confused because of the bad data in the page output by having duplicate galleries on the same page.

    I have added a development task to our backlog for FooGallery to check for existing galleries on a page, and create a unique ID when it finds duplicates. We are busy with some major updates at the moment, so after that we could get round to adding this to FooGallery.

    Thread Starter Chris

    (@osiak)

    Thanks @bradvin,
    I expected such answer and this is more or less obvious to me, same as not having an out of the box solution for this. Of course implementing a different ID for the duplicated gallery automatically would be a great feature. Now I guess the only solution is to duplicate my galleries and use the duplicated (different) ID on the mobile version.
    Anyway, thanks for your feedback. Would you have a rough ETA for the FooGallery duplicate ID fix implementation?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Duplicate galleries conflict with lightbox’ is closed to new replies.