I am trying to display my categories in a table format with the image thumbnail right above the category name. The trouble I am having, is that it is displaying a blank category in the first cell, and it is not displaying the last category at all. If you want to see it for yourself, go to
http://72.34.43.238/store/, the first category is Retractable Belted Barriers and the last one should be dancer poles. Here is my code: Thanks,
Code:
{* $Id: subcategories.tpl,v 1.43.2.7 2005/10/28 05:23:51 svowl Exp $ *}
{capture name=dialog}
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}{/if}<br><br>
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}
{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 2}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
{if $subcategories[cat_num].icon_url}<img src="{$subcategories[cat_num].icon_url}" border="0" style="padding-bottom: 5px;">{else}<img src="{$xcart_web_dir}/default_icon.gif" border="0" style="padding-bottom: 5px;">{/if} </a><br /><br />
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<b>{ $subcategories[cat_num].category|escape }</b></a><br><br>
{ $subcategories[cat_num].description|escape }</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}
{if $total_pages gt 2}
<br>
{ include file="customer/main/navigation.tpl" }
{/if}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra="width=100%"}
{if $products eq ""}
{if $f_products ne ""}
<BR><BR>
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }