View Single Post
  #13  
Old 10-11-2005, 07:13 AM
 
tabarsoft tabarsoft is offline
 

Advanced Member
  
Join Date: Sep 2005
Location: Montrц╘al, Canada
Posts: 31
 

Default Solution to use images without CSS !

Solution to use images without CSS !
Hello Mike and ETI

Good news I've got it!
If you want to use images without css you can use this code.
Any number of column, options disabled or not, and the table containing the swatch is now close correctly.
Code:
{if $variants} <table cellspacing="3" cellpadding="0" border="1" > {assign var="image_counter" value=0} {assign var="close_table" value=0} {section name=swatch loop=$variants} {foreach item=item key=key from=$variants[swatch].options} {if $item.option_name ne '' } {if $image_counter mod 5 eq 0} <tr> {assign var="image_counter" value=0} {/if} <td>{math equation="x+1" x=$image_counter assign="image_counter" } [img]{$ImagesDir}/{$item.option_name|replace:[/img]</td> {if $image_counter mod 5 eq 0 } </tr> {assign var="close_table" value=1} {else}{assign var="close_table" value=0} {/if} {/if} {capture name=image_index} {math equation="index+x+1" index=$image_counter x=5} {/capture} {/foreach} {/section} {if $close_table eq "0"}<td></td></tr>{/if} </table> {else} {/if}

It might not be the cleanest code but it works.
Feel free to improve it.

Martin
__________________
x-cart gold 4.0.15
Reply With Quote