WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: svsanchez on June 12, 2014, 10:31:33 PM

Title: Lightbox problem
Post by: svsanchez on June 12, 2014, 10:31:33 PM
Hello Bakers!

I am having a very strange problem with my Bakery installation on www.compugangas.com .gt: when I click on the thumbs, the lightbox does appear, but not on top of the page but instead it shows the image at the very bottom of the page. Here's a link to show my problem, just click on any of the thumbs images and you will see the scroll bar increases its size then at the bottom of the page you will see the lightbox image:

http://compugangas.com.gt/pages/bakery/hp-compaq-dc7700-dt-5.php
Title: Re: Lightbox problem
Post by: dbs on June 12, 2014, 10:54:05 PM
Hi, you want use jQuery and Prototype together.
This makes often problems.

And jQuery will loaded twice. One of this lines is enough
Code: [Select]
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
Title: Re: Lightbox problem
Post by: Gast on June 12, 2014, 11:49:08 PM
and maybe a newer jquery version helps


Quote
And jQuery will loaded twice. One of this lines is enough
one time more here
Code: [Select]
<script type="text/javascript" src="http://www.compugangas.com.gt/templates/round/jquery-1.4.2.js"></script>
Title: Re: Lightbox problem
Post by: svsanchez on June 13, 2014, 12:21:44 AM
Hello dbs and jacobi22, thanks a lot for your replies. Unfortunatelly, even after removing the extra calls to jquery the problem is still there. I also uploaded jquery version 2.1.1 but this didn't solve the problem either. What else could be causing this problem, please help!
Title: Re: Lightbox problem
Post by: dbs on June 13, 2014, 12:54:46 AM
The forum-search shows this: http://www.WebsiteBaker.org/forum/index.php/topic,23334.0.html
Hope it helps.

Title: Re: Lightbox problem
Post by: svsanchez on June 13, 2014, 02:53:42 AM
Thanks dbs, I think it will have to do something with the DIVs. Haven't solved it yet but I feel I'm on the right path thanks to your link!
Title: Re: Lightbox problem
Post by: freeSbee on June 13, 2014, 09:04:35 AM
Hi svsanchez

You have to include the Bakery frontend.css stylesheet that provides the necessary Lightbox styling:
http://www.bakery-shop.ch/#css

Regards Christoph
Title: Re: Lightbox problem
Post by: instantflorian on June 14, 2014, 11:15:42 AM
Hi,

there is still the problem that both libraries jQuery and prototype.js are loaded. If you don't need jQuery anewhere else, you can remove the line

Code: [Select]
<script type="text/javascript" src="http://www.compugangas.com.gt/templates/round/jquery-2.1.1.js"></script>
from the head of your template and try again.
If you need jQuery, you can either update bakery to 1.70 (but take care of the side effects, see release notes), this version does not use prototype any more.
 
The other possibilty is to edit the modules/bakery/view_item.php, if you don't want to update Bakery.

You can replace the lines in view_item.php where the lightbox is built manually with those from the view_item.php of Bakery 1.70 and edit the line where the lightbox link is built accordingly.

Or you remove the lines where prototype is loaded (around lines 40ff.) completely and edit the line where the thumbnail/lightbox links are generated (around line 158).
The line should be changed to something like
Code: [Select]
$prepend = "<a href='".$img_url.$image_file."' class='grouped_elements'  title='".$img_title."'><img src='";
or
Code: [Select]
$prepend = "<a href='".$img_url.$image_file."' rel='lightbox'  title='".$img_title."'><img src='";
Then you can add any jQuery lightbox script to your template which hopefully will do the trick.

hth
-Florian.
Title: Re: Lightbox problem
Post by: svsanchez on June 17, 2014, 08:27:30 AM
Hello everyone, thank you for your help. I was able to solve this by making again the template since I couldn't "clean" my code. Thanks to you I could determine that the lightbox was indeed working and that it was not the problem, but my template was so just making it again little by little fixed it :)