Thread: Looping
View Single Post
  #7  
Old 07-14-2005, 03:25 AM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

Quote:
Originally Posted by yoyonation
hahah that was simple. Thanks.

Now here is the actual looping question. Below is taken from my products_t.tpl...

Quote:
{* $Id: products_t.tpl,v 1.10.2.7 2004/12/23 09:11:59 max Exp $ *}
<TABLE border="0" width="100%" cellpadding="0" cellspacing="0" class="VertMenuBorder"><TR><TD class="TableThumbnailBorder">

<TABLE border="0" width="100%" cellpadding="5" cellspacing="1">

{math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"}

{section name=product loop=$products}
{assign var="discount" value=0}

{if %product.index% is div by $config.Appearance.products_per_row}
<TR>
{assign var="cell_counter" value=0}
{/if}

{math equation="x+1" x=$cell_counter assign="cell_counter" }

<TD align="center" valign="top" width="{$width}%" class="DialogBox">

It loops through ALL featured products, but I just want it to take only 3 products...any thoughts?


Change the line
Code:
{section name=product loop=$products}

to

Code:
{section name=product loop=$products max=3}
Reply With Quote