Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

custom template, error

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-15-2004, 11:14 AM
  ETInteractive.com's Avatar 
ETInteractive.com ETInteractive.com is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 747
 

Default 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
__________________
ETInteractive.com
X-Cart 3.5.x
Reply With Quote
  #2  
Old 11-15-2004, 11:50 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 11-15-2004, 12:45 PM
  ETInteractive.com's Avatar 
ETInteractive.com ETInteractive.com is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 747
 

Default

still wont work.

seems the first in the index is blank.

anybody?
__________________
ETInteractive.com
X-Cart 3.5.x
Reply With Quote
  #4  
Old 11-15-2004, 02:14 PM
  ETInteractive.com's Avatar 
ETInteractive.com ETInteractive.com is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 747
 

Default

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}
__________________
ETInteractive.com
X-Cart 3.5.x
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:12 PM.

   

 
X-Cart forums © 2001-2020