section
| From: | Jan van Vlimmeren | Date: | Wed, 23 Oct 2002 16:42:08 +0000 |
| Subject: | section | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6220@lists.php.net to get a copy of this message | ||
I'm still messing with my code. This is what I have:
<TR> {section name=looper loop=$r start=1}
<TD valign="TOP" width="35%"><p><a
href="browse.php3?cat={$link[looper]}">{$r[looper]}</a><br>
{section name=relooper loop=$sublinks start=0}
<a
href=browse.php?{$sublinks[looper][relooper].category_id}>{$sublinks[looper]
[relooper].name}</a>
{/section}<br>
</font></p>
</TD>
{* see if we should go to the next row *}
{if not ($smarty.section.looper.rownum mod 2)}
{if not ($smarty.section.looper.last)} </TR> <TR>
{/if}
{/if}
{if ($smarty.section.looper.last)} {* pad the cells not
yet created *}
{math equation = "n - a % n" n=2 a=$data|@count
assign="cells"}
{if $cells ne 2}
{section name=pad loop=$cells} <TD></TD>
{/section} {/if} </TR>
{/if}
{/section} </TABLE></td>
The problem is that with the sublinks it just halts looping when it reaches
half the array. You can see what I mean at www.honden.be/beta
all the main big links have sublinks, I just don't get them shown. Any
suggestions ?