I have a question about proper formatting for my subcategory rows. I have used previous posts on this topic (although quite difficult to apply because they are old) to alter my subcategory templates. This was in January I believe.
Well, now that I have 10 subcategories within a subcategory itself, they are not displayed properly. Initially, I set up the layout to show 5 subcategories per row. But now, it shows 5 in row 1, 4 in row 2 and 1 in row 3 (instead of filling a row before starting a new one).
I'm guessing that it has to do with the "$tmp" in my subcategories.tpl, but I haven't been able to change it to what I want it to do.
Here's the problem page that doesn't fill the rows completely:
Custom Valances
And here's my subcategories.tpl:
HTML Code:
{* $Id: subcategories.tpl,v 1.43.2.9 2006/06/27 08:22:01 svowl Exp $ *}
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<BR><BR>{/if}
{capture name=dialog}
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}
{if $subcategories}
<table class="sublisttable">
<tr>
{foreach from=$subcategories item=subcat}
{if $tmp is div by 4}
</tr>
<tr class="sublisttr">
{/if}
{ if $tmp and $first_subcat ne "Y" }
{assign var="tmp" value=0}
{assign var="first_subcat" value="Y"}
{/if}
<td class="subclist">
<a href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/default_image.gif{/if}" alt="Priority Windows Custom Products" width="150" height="150"><br>
<font class="ItemsList">{ $subcat.category|escape }</font><BR><img src="images/customize.png" width="150" height="25"></a>{if $config.Appearance.count_products eq "Y"}{/if}
{assign var="tmp" value=$tmp+1}
{/foreach}
</table>
{/if}
{if $tmp and $products ne "" }
<BR clear="left">
<HR size="1" noshade>
{/if}
{if $products}
{if $sort_fields}
<DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields
selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction
url="home.php?cat=`$cat`&"}</DIV>
{/if}
{if $total_pages gt 2}
<BR>
{ include file="customer/main/navigation.tpl" }
{/if}
<BR>
{include file="customer/main/products.tpl" products=$products}
{/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 ""}
<P>
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }
Thanks again!!!
