Lightbox not working

Permalink Browser Info Environment
When I add a gallery to a page, it shows up in the right size and order, but clicking the thumbnails just opens them in a new page rather than a modal window.

Also, when I go back to edit mode in that page, it's disabled--I can't click anything to edit it, or to add to blocks, and the only way out that I can see is to delete the page and start over.

The REALLY weird thing is that I'm simply copying a gallery from one site to another, using exactly the same photos and exactly the same settings, and on the first site it worked fine. What gives?

Type: Discussion
Status: New
1db
View Replies: View Best Answer
jordanlev replied on at Permalink Reply
jordanlev
It's probably due to a javascript conflict. The most frequent cause is that your theme or an addon is adding the jquery library to the header, but C5 already includes jquery on every page so having two of them creates problems. The next most frequent cause is another addon that uses the "Fancybox" jquery effect -- usually this is the "Popup Login" addon, but there may be others as well.

If you can provide a link to your site (and the specific page with the gallery on it), I can probably give you a more specific diagnosis.

-Jordan
1db replied on at Permalink Reply
1db
Thanks, Jordan. I am in fact using another Fancybox-type addon, Fancy Forms Template (http://www.concrete5.org/marketplace/addons/fancy-forms-template/). The only javascript the theme is calling separately is iepngfix_tilebg.js.

The URL ishttp://www.1stdesignbrigade.com/concrete/about/...

The URL for the first site, where the gallery is working, ishttp://www.pizzeriaritrovo.com/about/...
jordanlev replied on at Permalink Best Answer Reply
jordanlev
That is most likely the cause of the problem. You can confirm this by temporarily removing the fancy forms template from your page and seeing if the gallery works then.

If this is the case, you'll probably just want to use the fancy form template's copy of FancyBox since that is on every page already. So you can disable the Gallery's fancybox by editing this file:
packages/sortable_fancybox_gallery/blocks/sortable_fancybox_gallery/controller.php

and around line 15 or so you should see this:
public function on_page_view() {
   if ($this->enableLightbox) {

...change that to this:
public function on_page_view() {
   if (false) { //disabled to avoid conflict with Fancy Form Template addon


That should do it.

-Jordan
1db replied on at Permalink Reply
1db
That was it. From dead in the water to back up in an hour. Not too shabby.
vivavisual replied on at Permalink Reply
vivavisual
Hi!, it seems I am having a similar issue with lightbox.
It's working here:

http://www.kivavisual.com.ar/crissa/index.php/finalizados/...

but not here:

http://www.kivavisual.com.ar/crissa/index.php/finalizados-2/...

Any suggestions?, I made some changes in the view.php code but still cannot understand why is working in one of them, and not in the other.
I've just update to the last version. But I don´t think that would be a problem?.
1db replied on at Permalink Reply
1db
My problem was that two add-ons were both calling the fancybox function, and they weren't playing nicely together. I looked at your source code and your second version is calling fancybox twice:

crissa/packages/sortable_fancybox_gallery/blocks/sortable_fancybox_gallery/fancybox/jquery.fancybox-1.3.1.pack.js

crissa/packages/amiant_image_gallery/blocks/amiant_gallery/jquery.fancybox-1.3.1.pack.js

I would bet if you followed the same instructions above, it would work for you, too.
jordanlev replied on at Permalink Reply
jordanlev
Thanks @1db for helping out. I do want to clarify the above steps though: they worked for you because the other block you're using (fancy form template) is on every page of the site, so you can guarantee that it will load the fancybox code.
But @vivavisual has a different situation (I'm guessing) because the other block that is causing the conflict is another image gallery, which is probably not on every page of the site.

There is unfortunately no perfect solution here without writing a bunch of custom code. You may need to just choose one or the other gallery to be on a particular page and not have both on the same page.

I've been talking with some of the other addon authors about a long-term solution to this problem, because it keeps coming up more and more, and I hope that one day we can get something working. But it will probably be a while before that happens.

Sorry, wish I had a better answer :(
vivavisual replied on at Permalink Reply
vivavisual
Thanks anyway! I've solved it by uninstalling the other package which was causing me trouble with the sortable fancy box gallery. Now they are both working. I will remember this for the future, and keep investigating.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.