Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to Reference the Detailed image width and height values?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-04-2006, 12:25 PM
 
phil_ phil_ is offline
 

Advanced Member
  
Join Date: Feb 2003
Location: Northern Ireland
Posts: 56
 

Default 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.
__________________
-----------------------------------------
X-Cart5 v5.2.16 (Live)
-----------------------------------------
Reply With Quote
  #2  
Old 01-05-2006, 10:32 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 01-05-2006, 11:33 AM
 
phil_ phil_ is offline
 

Advanced Member
  
Join Date: Feb 2003
Location: Northern Ireland
Posts: 56
 

Default

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
__________________
-----------------------------------------
X-Cart5 v5.2.16 (Live)
-----------------------------------------
Reply With Quote
  #4  
Old 01-27-2007, 06:27 PM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default 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?
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #5  
Old 04-12-2007, 09:32 AM
 
reefland reefland is offline
 

Member
  
Join Date: Apr 2005
Posts: 16
 

Default Re: How to Reference the Detailed image width and height values?

You might do something like this:

Code:
{section name=image loop=$images} {if $images[image].avail eq "Y"} {if $images[image].tmbn_url} {section name=image loop=$images} {if $images[image].image_x > 460} <IMG src="{$images[image].tmbn_url}" alt="{$images[image].alt|escape}" width="460" /> {else} <IMG src="{$images[image].tmbn_url}" alt="{$images[image].alt|escape}" /> {/if} {/section}

This will keep any detailed image at or under 460px in width in or to keep it from breaking a style.
__________________
4.0.19
Reply With Quote

The following user thanks reefland for this useful post:
gosha (02-10-2010)
  #6  
Old 02-10-2010, 03:05 AM
 
gosha gosha is offline
 

Advanced Member
  
Join Date: May 2003
Posts: 64
 

Default 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.
__________________
XCart 4.7.10.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:44 PM.

   

 
X-Cart forums © 2001-2020