View Single Post
  #1  
Old 01-21-2003, 09:30 AM
 
jpsowin jpsowin is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 459
 

Default 2 Row Featured Products

Since I'm feeling nice and someone asked for it, here is the code I use to display my featured products in 2 seperate rows. This took me a while to do, since I'm not an expert in SMARTY tags. Anyhoo, here it is.

Code:
{* $Id: featured.tpl,v 1.13 2002/05/20 06:55:20 lucky Exp $ *} {* petsupplyonline featured products template *} {* not released under any licence, not allowed to sell this *} {capture name=dialog} {if $f_products ne ""} {section name=product loop=$f_products} { if %product.first% } <table border="0" width="500" align="center"> {/if} { if %product.index% is even } <tr> <td><table width="250" border="0" > <tr> <td width="80" rowspan="5"> {* IMAGE *} <a href=product.php?productid={$f_products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$f_products[product].productid product=$f_products[product].product}</a></td> </tr> <tr> <td> {* NAME *} {$f_products[product].product|escape}</font> <font class=ProductTitle></font> </td> </tr> <tr> <td> {* DESCRIPTION *} {$f_products[product].descr|truncate:135:"...":true} </td> </tr> <tr> <td> {* PRICE *} <font class=ProductPriceTitle>Price: {include file="currency.tpl" value=$f_products[product].price}</font><font class=ProductPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$f_products[product].price}</font> </td> </tr> <tr> <td> <a href=product.php?productid={$f_products[product].productid}&cat={$cat}&page={$navigation_page}> { include file="buttons/more_info.tpl" } </a> </td> </tr> </table> </td> {else} <td><table width="250" border="0"> <tr> <td width="80" rowspan="5"> {* IMAGE *} <a href=product.php?productid={$f_products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$f_products[product].productid product=$f_products[product].product}</a></td> </tr> <tr> <td> {* NAME *} {$f_products[product].product|escape}</font> <font class=ProductTitle></font> </td> </tr> <tr> <td> {* DESCRIPTION *} {$f_products[product].descr|truncate:135:"...":true} </td> </tr> <tr> <td> {* PRICE *} <font class=ProductPriceTitle>Price: {include file="currency.tpl" value=$f_products[product].price}</font><font class=ProductPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$f_products[product].price}</font> </td> </tr> <tr> <td> <a href=product.php?productid={$f_products[product].productid}&cat={$cat}&page={$navigation_page}> { include file="buttons/more_info.tpl" } </a> </td> </tr> </table> </td> </td> </tr> {/if} { if %product.last% } </table> {/if} {/section} {else} {$lng.txt_no_featured} {/if} {/capture} {include file="dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog extra="width=100%"}
__________________
Joshua Sowin
...taking things one TPL at a time.
Reply With Quote