View Single Post
  #1  
Old 12-28-2006, 08:18 PM
 
justme justme is offline
 

Member
  
Join Date: Jul 2004
Location: Western New York State, USA
Posts: 28
 

Default Two Main Category Sections

Here's how to add a second category box:
Modification is in bold, green, you can copy & paste only this part if your categories.tpl code is different than mine.
This works in versions 3.5 - 4.0.18. I have not tried it in v4.1.xx


In Languages, create (add new entry) two new labels:

variable: lbl_categories1
description: categories 101-199 (edit numbers as needed)
value: (your category name)

variable: lbl_categories2
description: categories 201-299 (edit numbers as needed)
value: (your category name)

Create two new files in the Customer directory (same place you find categories.tpl)

First new file name: categories1.tpl
Paste in the following code. Edit the numbers in bold, red as needed. Save file.

Code:
{* $Id: categories1.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} {if $categories[cat_num].order_by > 100 and $categories[cat_num].order_by < 199} <FONT class="CategoriesList"><A href="home.php?cat={$categories[cat_num].categoryid}" class="VertMenuItems">{$categories[cat_num].category}</A></FONT><BR> {/if} {/section} {else} {section name=cat_num loop=$subcategories} {if $categories[cat_num].order_by > 100 and $categories[cat_num].order_by < 199} <FONT class="CategoriesList"><A href="home.php?cat={$subcategories[cat_num].categoryid}" class="VertMenuItems">{$subcategories[cat_num].category}</A></FONT><BR> {/if} {/section} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories1 menu_content=$smarty.capture.menu }


Second new file name: categories2.tpl
Paste in the following code. Edit the numbers in bold, red as needed. Save file.

Code:
{* $Id: categories2.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} {if $categories[cat_num].order_by > 200 and $categories[cat_num].order_by < 299} <FONT class="CategoriesList"><A href="home.php?cat={$categories[cat_num].categoryid}" class="VertMenuItems">{$categories[cat_num].category}</A></FONT><BR> {/if} {/section} {else} {section name=cat_num loop=$subcategories} {if $categories[cat_num].order_by > 200 and $categories[cat_num].order_by < 299} <FONT class="CategoriesList"><A href="home.php?cat={$subcategories[cat_num].categoryid}" class="VertMenuItems">{$subcategories[cat_num].category}</A></FONT><BR> {/if} {/section} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories2 menu_content=$smarty.capture.menu }

In customer/home.tpl

REPLACE (or comment out)
Code:
{ include file="customer/categories.tpl" }
with the following:

Code:
{ include file="customer/categories1.tpl" } { include file="customer/categories2.tpl" }
Set the Category Position (POS) so each category shows up in the appropriate category box. Example: categories1.tpl calls for categories numbered from (POS) 100 to 199. " {if $categories[cat_num].order_by > 100 and $categories[cat_num].order_by < 199} "


Note: To add more category boxes, you also need to edit the category name (in bold) in two places in each new template(s) you create.

Code:
{* $Id: categories2.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} >> >> { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories2menu_content=$smarty.capture.menu }



JustMe
Reply With Quote