![]() |
How to Reference the Detailed image width and height values?
Hi,
I need to be able to pass the width and height of the detailed images into some code. I know that {$product.image_x} and {$product.image_y} gives me the value for the thumbnail width and height. What is the corresponding variable that holds the detailed image width and height, or how can I generate this? Thanks, Philip. |
Not sure X-Cart defines these by default, as the detailed image just defaults to its actual size. TelaFirma has done a detailed image mod that defines these though, may want to check with him or buy his mod.
|
I ended up placing a ticket with support. Actually its rather simple to do using the following snippet.
{$images[array_element_number].image_x} {$images[array_element_number].image_y} So if you wanted to acces the first detailed image's width and height, you would use; {$images[0].image_x} and {$images[0].image_x} and if you wanted to refer to all the stored images for a product, you could use the following section definition to loop through them. {section name=image loop=$images} {$images[image].image_x} {$images[image].image_y} {/section} Hope someone else finds the info useful. Philip |
Re: How to Reference the Detailed image width and height values?
Philip, do you have any code example of how to pass the width and height of the detailed images into detailed image code?
|
Re: How to Reference the Detailed image width and height values?
You might do something like this:
Code:
{section name=image loop=$images} This will keep any detailed image at or under 460px in width in or to keep it from breaking a style. |
Re: How to Reference the Detailed image width and height values?
Not really what I was looking for, but it pointed me in the right direction and I solved my problem.
So thanks alot and kudos to you. :) |
All times are GMT -8. The time now is 06:11 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.