In regards to my last post. Storing an image in the 'large' folder has no effect.
In regards to my last post. Storing an image in the 'large' folder has no effect.
Well, I identified one part of the problem. ZenCart 1.3.7.1 made some good changes. Zen now catches when medium and large image versions don't exist and will use the standard image by default. The file adversely affecting lightbox (and IH2) is /includes/modules/main_product_image.php.
When the 1.3.7.1 code is removed lightbox operates correctly but the product image is missing.
When the 1.3.7.1 code is added the product image is correct but 'some' lightbox images won't pull up. Keep in mind that my /images/medium & /images/large
folders are empty. IH2 handles the resizing.
Hopefully this info will help someone.
Alright. Everything I wrote previously was correct... but moot.
Now how about a solution, huh? (for those having a problem.)
Replace /includes/templates/YOUR-TEMPLATE/templates/tpl_modules_main_product_image.php with the following:
Basically, the problem was with LARGE_IMAGE_WIDTH and LARGE_IMAGE_HEIGHT so I hard coded them with '800' and '600'.Code:<?php /** * Module Template * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: tpl_modules_main_product_image.php 3208 2006-03-19 16:48:57Z birdbrain $ */ ?> <?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> <div id="productMainImage" class="centeredContent back"> <!-- begin zen lightbox v1.3 aclarke 2006-10-20 --> <script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="' . zen_image_lightbox_IH2_url($products_image_large, addslashes($products_name), '800', '600') . '" rel="lightbox[gallery]" title="' . addslashes($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>'); //--></script> <!-- end zen lightbox v1.3 aclarke 2006-10-20 --> <noscript> <?php echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?> </noscript> </div>
Bada Bing. Not an elegant solution... but it works!
Is there any way i can get this to open up in an absolute position? Like always 60px from the top of the page? Right now it opens up relative to how far you are scrolled down on the page.
[FONT=Arial]Misery Loves Co. - Offering urban clothing and fashion accessories
[/FONT]
/includes/templates/template_default/lightbox.js
Edit line 352
Code:var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 15);I discovered these on my own so the experts can offer a cleaner solution if they know of it.
- Replace the '/15' with a greater number to reduce the space above your images.
- Erase '+ (arrayPageSize[3] / 15)' to remove the top spacing altogether
- Erase 'arrayPageScroll[1] + ' to remove it's 'adjust to scroll' features (though I don't know why you would want to do that)
BTW. Edit Line 65 to adjust lightbox's resize speed.
I use Lightbox with Zen 1.3.7 + IH2 and have no problem with image not showing, no code needed to be modified.
Anyway, 1 tip for all: since lightbox is used only when the customers view the product in product_info page, there is no reason to load it on every page and slow down your site, you can rename stylesheet_lightbox.css to product_info.css
I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me
Does any one know a way to use lightbox in an ezpage?
I need to make a page of thumbnails that when clicked, open in to large images using lightbox.