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

Tiny little mod to accent category being browsed

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 12-08-2005, 07:18 PM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default Tiny little mod to accent category being browsed

No big deal. It just adds BOLD to category menu that you are browsing so it makes navigation friendlier
in skin1/customer/category.tpl replace the loop=$categories section with

Code:
{section name=cat_num loop=$categories} {if $smarty.get.cat eq $categories[cat_num].categoryid} {$categories[cat_num].category} {else} {$categories[cat_num].category} {/if} {/section}
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #2  
Old 12-11-2005, 08:49 AM
 
dgraven dgraven is offline
 

Newbie
  
Join Date: Nov 2005
Posts: 1
 

Default

This looks like a nice mod.....however, I could only find a skin1/customer/categories.tpl file (vs. category.tpl)? I tried it in that template a received this smarty error:

Fatal error: Smarty error: [in customer/categories.tpl line 6]: syntax error: unrecognized tag: {section name=cat_num loop=$categories (Smarty_Compiler.class.php, in /home/bootylou/public_html/Smarty-2.6.9/Smarty.class.php on line 1088

Thoughts?

Doug

ver: 4.016
__________________
dg
Reply With Quote
  #3  
Old 12-11-2005, 10:41 AM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

that was categories.tpl, sorry. I am using 4.0.17 and in there the original does have {section name=cat_num loop=$categories} so I don't know what to tell you.
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #4  
Old 12-28-2005, 04:42 PM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default

"Fatal error: Smarty error: [in customer/categories.tpl line 6]: syntax error: unrecognized tag: {section name=cat_num loop=$categories (Smarty_Compiler.class.php, in /home/bootylou/public_html/Smarty-2.6.9/Smarty.class.php on line 1088 "

Are you sure the template has the closing bracket on {section name=cat_num loop=$categories} as in your error example it does not>
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #5  
Old 12-28-2005, 04:54 PM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

here is my complete working template.

Code:
{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} <div id="categories"> {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 $smarty.get.cat eq $categories[cat_num].categoryid} {$categories[cat_num].category} {else} {$categories[cat_num].category} {/if} {/section} {/if} {/if} </div> {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #6  
Old 06-01-2006, 07:28 AM
 
taltos1 taltos1 is offline
 

Senior Member
  
Join Date: Mar 2005
Location: USA
Posts: 160
 

Default

Great small mod. To get this working on 4.0.18

Code:
{section name=cat_num loop=$categories} <FONT class="CategoriesList">{$categories[cat_num].category}</FONT> {/section} {else} {section name=cat_num loop=$subcategories} <FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT> {/section}

With
Code:
{section name=cat_num loop=$categories} {if $smarty.get.cat eq $categories[cat_num].categoryid} {$categories[cat_num].category} {else} {$categories[cat_num].category} {/if} {/section}

NOTE: I added in the two
tags so that each new category would be on a new line, remove them and them will all be inline!
Thanks again!
__________________
X-Cart Gold Version 4.0.18
EWDHosting.com is my Host
Unix Servers
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 12:03 PM.

   

 
X-Cart forums © 2001-2020