Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 7
lightbox 2.0 only in custom template
 
Black Cat
Mentor
 
Avatar
Total Posts:  3481
Joined:  2008-02-14
Assemini / Cagliari (Italy)
 

Hi,
I have followed the guide in the wiki to insert lightbox 2.0 but I would like the whole necessary files for lightbox to be inserted only in the folder of the custom designed template.
Then I would like the files to be alone in the briefcase skin/default/my_theme and in app/design/frontend/default/mytheme/ecc..

Besides I would possibly like the links to be “relative” to the template, that is changing the name of the folder of the template, continuous lightbox to work.

I have made some attempt but lightbox it doesn’t work and the image opens me in a new window

Can someone help me?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jay@grimestore
Member
 
Avatar
Total Posts:  49
Joined:  2008-04-02
 

I have also followed the wiki on how to add lightbox, but done it with a custom template and it is not working also. The main product image when on the product now no longer zooms in and out when you click the zoom buttons. Also when I click the images I merely get tkaen to the image and lightbox does not work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
laurent
Member
 
Total Posts:  75
Joined:  2007-08-31
Paris, France
 

The js:
- put lightbox.js in my_skin/js directory

- in lightbox.js, find

var fileLoadingImage "images/loading.gif";        
var 
fileBottomNavCloseImage "images/closelabel.gif";
replace with
var fileLoadingImage SKIN_URL "images/lightbox/loading.gif";        
var 
fileBottomNavCloseImage SKIN_URL "images/lightbox/closelabel.gif";

- in page/html/head.phtml, find

<script type="text/javascript">
    var 
BLANK_URL '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
    var 
BLANK_IMG '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
</script>
replace with
<script type="text/javascript">
    var 
BLANK_URL '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
    var 
BLANK_IMG '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
    var 
SKIN_URL '<?php echo $this->helper('core/js')->getJsSkinUrl('') ?>';
</script>

-in your catalog.xml, find

<catalog_product_view>
    
[...]
    
<reference name="head">

add the following lines right after the previous code

<action method="addItem"><type>skin_js</type><name>js/lightbox.js</name></action>
<
action method="addItem"><type>skin_css</type><name>css/lightbox.css</name></action>

The css
- put lightbox.css in my_theme/css directory
- change all the image url to be like : url(../images/lightbox/image.gif)

The images:
-put all the lightbox images in my_skin/images/lightbox/

Don’t forget to insert lightbox into magento product details. (Adding Lightbox to magento V2 step 5 from wiki).

 
Magento Community Magento Community
Magento Community
Magento Community
 
kylewhat
Member
 
Total Posts:  45
Joined:  2008-06-02
 

*edit*..

 
Magento Community Magento Community
Magento Community
Magento Community
 
luffy59
Jr. Member
 
Total Posts:  3
Joined:  2008-07-16
 

Hey thanks for this explication. In the wiki tutorial he didn’t mention the modification of the files catalog.xml

 
Magento Community Magento Community
Magento Community
Magento Community
 
Darren E
Member
 
Avatar
Total Posts:  54
Joined:  2008-05-23
The Woodlands, Texas
 

For some reason, clicking an image just opens the image in the browser. In order to get back to the products, you must use the back button on the browser.

I swear, I have gone through these steps several times - no such luck.

the site: http://boardbookalbums.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiaraweb
Guru
 
Avatar
Total Posts:  721
Joined:  2008-03-21
Aviano ~ Italy
 
Darren E - 21 August 2008 10:05 AM

For some reason, clicking an image just opens the image in the browser. In order to get back to the products, you must use the back button on the browser.

I swear, I have gone through these steps several times - no such luck.

the site: http://boardbookalbums.com

I can’t see lightbox into your site, but I’m sure that if X close doesn’t show up the reason is the incorrect path of close.gif image

if you have developer toolbar of Firefox you can find the broken images

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lorenzo66
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-06-04
London, UK
 

Darren,
I just came here by chance as I am working on the lightbox for the 1.1.5 version of magento (btw, now we can use the 2.04 version of lightbox).
I had a look on your web site. The missing file is lightbox.js which needs to go on the js folder under the skin/frontend/default/default as you can see if you look at the html source of your page:

...
<
script type="text/javascript" src="http://boardbookalbums.com/skin/frontend/default/default/js/lightbox.js" ></script>
...

I hope that will help you.

Lorenzo

 
Magento Community Magento Community
Magento Community
Magento Community
 
speedyss
Jr. Member
 
Total Posts:  24
Joined:  2008-07-02
 

I have the same problem, I have double checked that all files are there but still not getting lightbox to work. It only opens up the product image in the same web browser window. Any help?

website address is http://www.crickethaven.co.uk/shop

 
Magento Community Magento Community
Magento Community
Magento Community
 
speedyss
Jr. Member
 
Total Posts:  24
Joined:  2008-07-02
 

oops wrong thread!

 
Magento Community Magento Community
Magento Community
Magento Community
 
serpico
Jr. Member
 
Total Posts:  9
Joined:  2008-08-28
 

For some reason I can’t get this working. I thought I followed the instructions properly. Can anyone see where I’m going wrong?
http://www.fhtcruises.com/noosa-hilton-hotel.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
José Feliphe
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2008-09-09
Brasil - São Paulo - SP
 

serpico, your problem, is my problem!

Can anyone see where we going wrong?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lorenzo66
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-06-04
London, UK
 

Hi guys,
in which folder did you put the lightbox/lightbox.js file?
Lorenzo

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sokki
Jr. Member
 
Total Posts:  1
Joined:  2008-09-26
 

Hi Guys,

Places lightbox/lightbox.js under the main js folder eg domain.com/store/js/

The wiki tells us to place the js files in the incorrect spot.

Hope this helps ppl

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hercilio Costa
Member
 
Total Posts:  59
Joined:  2008-07-15
 
Sokki - 01 October 2008 04:23 AM

Hi Guys,

Places lightbox/lightbox.js under the main js folder eg domain.com/store/js/

The wiki tells us to place the js files in the incorrect spot.

Hope this helps ppl

I keep lightbox/lightbox.js in skin/frontend/default/default/js, but for this work in page.xml I replaced the lines that wiki tell us to insert:

<action method="addJs"><script>lightbox/lightbox.js</script></action>
<
action method="addCss"><stylesheet>css/lightbox.css</stylesheet></action>

for this two lines:

<action method="addItem"><type>skin_js</type><name>js/lightbox/lightbox.js</name></action>
<
action method="addItem"><type>skin_css</type><name>css/lightbox.css</name></action>

And I don’t have to insert anything in catalog.xml since page.xml put this lines in all pages.

 
Magento Community Magento Community
Magento Community
Magento Community
 
serpico
Jr. Member
 
Total Posts:  9
Joined:  2008-08-28
 

Hi Guys,

I’ve placed the JS file in a number of different places and still can’t get it to work. It looks like the main JS file just isn’t being called at all! Please take a look at:
http://www.fhtcruises.com/noosa-holiday-inn.html

So far I have a copy of the JS file at:

domain.com/lightbox.js
domain.com/lightbox/lightbox.js
domain.com/skin/frontend/default/modern/js/lightbox/lightbox.js
domain.com/skin/frontend/default/modern/js/lightbox.js

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 7