WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: imakeart on February 07, 2012, 08:17:08 PM

Title: Lightbox not working
Post by: imakeart on February 07, 2012, 08:17:08 PM
Lightbox is not working in Bakery. It's a little difficult to explain, basically it's not popping up, instead it is showing the image further down the web page. You can see it at the url below, just click on one of the thumbnails:

http://amandamakepeace.com/art/pages/artshop/white-feather-bookmark-42.php (http://amandamakepeace.com/art/pages/artshop/white-feather-bookmark-42.php)

Has anyone seen this happen before?

I'm running Website Baker 2.8.2 SP 2 with the latest version of the Bakery module.

If anyone has a fix, I can probably do it myself, if you share the code and where it goes--but this is not my area of expertise.
Title: Re: Lightbox not working
Post by: freeSbee on February 07, 2012, 09:06:52 PM
Hi imakeart

http://www.bakery-shop.ch/#css
http://www.bakery-shop.ch/#js
http://www.websitebaker2.org/en/help/designer-guide/enhanced-template-elements.php#anker4

Regards Christoph
Title: Re: Lightbox not working
Post by: imakeart on February 07, 2012, 09:15:30 PM
Thank you!!

I knew it would end up being something simple. Everything works now.
Title: Re: Lightbox not working
Post by: Het Artiek on September 24, 2012, 09:14:25 AM
My picture is still at the bottom of the page  :?
Title: Re: Lightbox not working
Post by: jacobi22 on September 24, 2012, 12:56:39 PM
please post a link to the Problem
Title: ....
Post by: Het Artiek on October 01, 2012, 12:24:37 PM
....
Title: Re: Lightbox not working
Post by: yppds on October 22, 2012, 07:28:34 PM
Hello,

I seem to have a more complicated problem than imakeart, before.

I have downloaded bakery 1.6 and install it in on a clean installation of WB 283sp1. I am using the round template which as far as I see, contains already the
            register_frontend_m odfiles('css');
            register_frontend_m odfiles('js');

I have not modified any other file, just add a new product with 3 images. The issue is that I cannot see the other images. LIghtbox opens up, and shows only the main image. There are no prev-next links, only the main image.

I have reproduced the problem on 3-4 different setups. I have just seen from firebug that there might be the case prototype.js is not updated. Even though I have updated, the problem still persists.

Do you have any idea what is happening?

Thanks for your help.
Title: Re: Lightbox not working
Post by: jacobi22 on October 22, 2012, 08:39:32 PM
please check the bakery page settings
Overview (Product-Loop) ->
THUMB is (only) the main image
THUMBS = all images

Item Detail (Footer):
IMAGE = only main image
IMAGES = all images
Title: Re: Lightbox not working
Post by: yppds on October 23, 2012, 07:14:51 PM
Jacobi22,

Thank you soooo much. You saved me a lot of time and effort.

Can I ask one more thing perhaps you have deal with this. I have replaced [IMAGE] with [THUMB]. This suites me better to have smaller images and when clicked to see the normal image under lightbox.

Is it possible, instead of showing many thumbnails(or images), to show only one and the other images to be visible only when lightbox is played?

What do you think?

Thanks
Title: Re: Lightbox not working
Post by: jacobi22 on October 23, 2012, 08:25:50 PM
its "very simple"  ;-)

count the pics in the THUMBS-Array, give only the first THUMB the standard css-class and the otherones a new CSS-Class and set this pictures to display: none;

thats all   :-D

BUT the Problem...
the customer doesnt know, that you have more than one picture.....
maybe it helps, if you put a little tip in the template (page settings -> details (footer)
like this
Code: [Select]
[THUMBS]
(click here for more pics)
<table border="0" ................>

the solution:

your frontend.css (for bakery)
build a new class like this

Code: [Select]
.mod_bakery_item_thumb_fff {
        border: none;
        display:none;
}

view_item.php
1. search this code-lines  (original in line 137)
Code: [Select]
// Check if the thumb and image directories exist
        if (is_dir($thumb_dir) && is_dir($img_dir)) {
behind this line define your counter with this line
Code: [Select]
$ix = 0;
behind this lines (original in line 173)
Code: [Select]
// Make array
                                $thumb_arr[] = $prepend.$thumb_url.$thumb_file.$thumb_append;
                                $image_arr[] = $prepend.$img_url.$image_file.$img_append;

write this:
Code: [Select]
$ix++;
these lines here build the pictures links, if you use lightbox

Code: [Select]
if ($setting_lightbox2 == "detail" || $setting_lightbox2 == "all") {
                                        $prepend = "<a href='".$img_url.$image_file."' rel='lightbox[image_".ITEM_ID."]' title='".$img_title."'><img src='";
                                        $thumb_append = "' alt='".$img_title."' title='".$img_title."' class='mod_bakery_item_thumb_f' /></a>";
                                        $img_append = "' alt='".$img_title."' title='".$img_title."' class='mod_bakery_item_img_f' /></a>";
                                // ...else add thumb/image only
                                }

change this lines to

Code: [Select]
if ($setting_lightbox2 == "detail" || $setting_lightbox2 == "all") {
if ($ix == 0){
                                    $prepend = "<a href='".$img_url.$image_file."' rel='lightbox[image_".ITEM_ID."]' title='".$img_title."'><img src='";
                                        $thumb_append = "' alt='".$img_title."' title='".$img_title."' class='mod_bakery_item_thumb_f' /></a>";
                                        $img_append = "' alt='".$img_title."' title='".$img_title."' class='mod_bakery_item_img_f' /></a>";}
                                        else{


                                        $prepend = "<a href='".$img_url.$image_file."' rel='lightbox[image_".ITEM_ID."]' title='".$img_title."'><img src='";
                                        $thumb_append = "' alt='".$img_title."' title='".$img_title."' class='mod_bakery_item_thumb_fff' /></a>";
                                        $img_append = "' alt='".$img_title."' title='".$img_title."' class='mod_bakery_item_img_f' /></a>";
                                        }
                                // ...else add thumb/image only


the first picture in the thumbs-array has the (original-)class mod_bakery_item_thumb_f
the next pics has the class mod_bakery_item_thumb_fff


Title: Re: Lightbox not working
Post by: yppds on October 25, 2012, 01:57:53 PM
Hello Jacobi,

Again thank you very much for your help.
Your tweak is great and i have already apply it, but it seems to be happening the following.

When I add a product, a new product and view it, the hidden images are also viewed. So, the product shows lets say 5 images one next to the other. Normally, I should only see one image and the other 4 should be hidden and viewed only in lightbox.
Now, If i hit the refresh button (F5) everything is corrected. But on any new image, it seems that it holds some cache.

Is this normail?