X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   custom template, error (https://forum.x-cart.com/showthread.php?t=10389)

ETInteractive.com 11-15-2004 11:14 AM

custom template, error
 
I had a template i made off of subcats

its for boomers BMY mod, i want to list all brands in a 3 column layout.

it works fine, except the FIRST row/column is always blank.

I have the select to select all where brand is not null.

i has to do with the index looping in the code below

Code:

{ include file="location.tpl" last_location="Search by Brand"}
{ include file="customer/main/navigation.tpl" }
{capture name=dialog}
{assign var="tmp" value="0"}
{section name=cat_num loop=$brand}
{if $brand[cat_num].brand}{assign var="tmp" value="1"}{/if}
{/section}
{section name=cat_num loop=$brand}
{ if %cat_num.first% }
<table border=0 cellspacing=5 width=100%>
{/if}
  {if $smarty.section.cat_num.index is div by 3}
    </tr><tr valign="top">
  {/if}
<td valign="top" width="33%" align="center">
<a class="VertMenuItems" href="bmy_search.php?brand={ $brand[cat_num].brand }">
{ $brand[cat_num].brand }</a>
  </td>
{ if %cat_num.last% }
</tr></table>
{/if}
{/section}


{if $smarty.section.cat_num.index is div by 3} seems to cause the output of </tr> at the beginning, but not sure why?

any ideas??

image below

http://www.etinteractive.com/misc/error.jpg

B00MER 11-15-2004 11:50 AM

Code:

{if $smarty.section.cat_num.index is div by 3 && %brand.index% ne 1}

%brand.index% may equal 0 at first so try that also.

ETInteractive.com 11-15-2004 12:45 PM

still wont work.

seems the first in the index is blank.

anybody?

ETInteractive.com 11-15-2004 02:14 PM

GOT IT.

just had to transpose the If's

Code:

  {if $brand[cat_num].brand ne ""}
<td valign="top" width="33%" align="center">
<a class="VertMenuItems" href="bmy_search.php?brand={ $brand[cat_num].brand }">
{ $brand[cat_num].brand }</a>
  </td>
  {/if}
    {if $smarty.section.cat_num.index is div by 3}
    </tr><tr valign="top">
  {/if}



All times are GMT -8. The time now is 09:40 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.