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

Modifying sub-category table

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-06-2003, 05:07 AM
 
devineone devineone is offline
 

Member
  
Join Date: Jan 2003
Posts: 25
 

Default Modifying sub-category table

I am trying to modify the sub categories. Currently they are listed in one single column. However I have more than 15 different product lines in the sub category. Is it possible to make them line up in separate columns so that there is not so much wasted space. The pictures start too low down on the page with one column of categories. Maybe 4 columns of 4 different product lines. Any help would be appreciated.


Thanks
Cory
Reply With Quote
  #2  
Old 01-08-2003, 07:10 PM
 
Ventrue Ventrue is offline
 

Newbie
  
Join Date: Oct 2002
Posts: 9
 

Default I have my Subs in two columns

I looked through the Smarty Code website and figured out how to get mine into two columns, I am sure you can easily do four with some modifications.

Here is the code for Two Columns
Code:
<table width=100%> <TR> <TD width=100%> <table border=0 cellspacing=5 width=100%> <TR> <TD colspan=3><Center><U>Shop by Category</U> </TD> </TR> <TR> <td align=left valign=top width=50%> {section name=cat_num loop=$subcategories max=4} <font size=2>{ $subcategories[cat_num].category|escape }</font> { if %cat_num.last% } {/if} {/section} </td> <TD width=1 bgcolor=#B10304></TD> <td align=left valign=top width=50%> {section name=cat_num loop=$subcategories start=4} <font size=2>{ $subcategories[cat_num].category|escape }</font> {/section} </TD> </tr> <TR> <TD colspan=3 height=1 bgcolor=#B10304></TD> </TR> </table> The Key is this "start=4}" You would put that at each place you would like it to start a new column. So for example in column one you would have the code with the "max=4}" which means only 4 products per line. on the next column you would put "{section name=cat_num loop=$subcategories start=4}" this starts the second column on the fifth product and continues on till the 8th product. On the third line you would put "{section name=cat_num loop=$subcategories start=8}" and this would start that line on the 9th product and so on and so on. Though the Key here is the <table> code like in my example, that code is what allows it to show up as 4 columns. Good Luck, If you need more help let me know.

[/code]
Reply With Quote
  #3  
Old 01-08-2003, 08:12 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

You could also use is div by.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #4  
Old 01-13-2003, 07:23 AM
 
devineone devineone is offline
 

Member
  
Join Date: Jan 2003
Posts: 25
 

Default

How would you use the "DIV by" to make your subcategories appear in columns?
Reply With Quote
  #5  
Old 01-13-2003, 09:11 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:
<table border="0" cellspacing="5" cellpadding="0" width="100%"><Tr> {section name=product loop=$f_products} {if $smarty.section.product.index is div by 3} </tr><tr align="center" valign="top"> {/if} {* Product stuff here *} </td></tr></table> {/section}

This is how I did it with the product listing same scenerio with the category list.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #6  
Old 01-13-2003, 10:01 AM
 
devineone devineone is offline
 

Member
  
Join Date: Jan 2003
Posts: 25
 

Default

Boomer, Hate to do this but can't get it without a parse error. When I follow the example code you gave, it ain't working. What would I be doing wrong?


This is the code that I am using:

Code:
{* $Id: subcategories.tpl,v 1.21 2002/09/10 12:36:34 zorg Exp $ *} { include file="location.tpl" } { include file="customer/main/navigation.tpl" } <p align="center"> {if ($page eq "")||($page eq "1")}{$current_category.description|regex_replace:"/ [\n]/":" "} {/if} <p align="center">{capture name=dialog} {if $subcategories} [img]../icon.php?categoryid={$cat}[/img] {/if} </p> {if $current_category.categoryid eq 282} <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="F8F9F9"><div align="left">[img]http://www.oceansbridge.com/img/monet-bio-intro1.gif[/img]</div></td> </tr> <tr> <td bgcolor="F8F9F9"></td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="375d7e"> <tr> </tr> </table> <hr noshade></td> </tr> </table> {elseif $current_category.categoryid eq 123} {include file="file_with_code2.txt"} {else} {section name=cat_num loop=$subcategories} { if %cat_num.first% } {/if} <table border=0 cellspacing=5 width=95%> {section name=subcat loop=$subcategories} {if $smarty.section.subcat.index is div by 3} </tr><tr align="center" valign="top"> {/if} <a href="home.php?cat={ $subcategories[cat_num].categoryid }"><font class="TableCenterSubCategoryListTitleBlue">{ $subcategories[cat_num].category|escape }</font></a> </td> <td align=right nowrap><font class="TableCenterSubCategoryListQuantityBlue">{ $subcategories[cat_num].product_count } {$lng.lbl_products}</font></td> </tr> { if %cat_num.last% } </table> {/if} {/section} {/if} {if $subcategories ne "" and $products ne ""} <hr size=1 noshade> {/if} {include file="customer/main/products.tpl" products=$products} {if $products eq "" and $subcategories eq ""} {$lng.txt_no_products_in_cat} {/if} {/capture} {include file="dialog.tpl" title=$current_category.category|regex_replace:"/.*\//":"" content=$smarty.capture.dialog extra="width=100%"} {if $products eq ""} {if $f_products ne ""} {include file="customer/main/featured.tpl"} {/if} {/if} { include file="customer/main/navigation.tpl" }
Reply With Quote
  #7  
Old 01-13-2003, 11:48 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

Just updated your post, try that.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #8  
Old 01-13-2003, 05:28 PM
 
devineone devineone is offline
 

Member
  
Join Date: Jan 2003
Posts: 25
 

Default

Thanks,

But running into the same problem. Not sure what it is.

Parse error: parse error in /usr/local/plesk/apache/vhosts/oceansbridge.com/httpdocs/cart/templates_c/%%103/%%1035601712/subcategories.tpl.php on line 129


Cory
Reply With Quote
  #9  
Old 05-10-2003, 02:46 AM
 
chawla@moviesandgamesonli chawla@moviesandgamesonli is offline
 

Senior Member
  
Join Date: Mar 2003
Location: UK
Posts: 125
 

Default

I get the same parse error, when i tried the above code, has anyone found out how to do this without the error?
Reply With Quote
  #10  
Old 05-12-2003, 08:49 AM
 
jeffseo jeffseo is offline
 

Newbie
  
Join Date: Mar 2003
Posts: 2
 

Default

It lokd great but where can I do this?
I mean what .tpl file or .php file ?
Where should I start from?
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:52 PM.

   

 
X-Cart forums © 2001-2020