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

category menu syntax

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-27-2008, 09:14 AM
 
techspaces techspaces is offline
 

Advanced Member
  
Join Date: Aug 2008
Posts: 95
 

Default category menu syntax

I'm creating custom menus for landing pages and I need the categories menu to only parse a specific subcategory. What I don't know is how to alter the syntax to limit to a specific category id. Here's the code I've got so far.

Code:
<ul class="categoryitems"> {foreach from=$c.subcats item=sc name=cm2} {if $sc.subcats eq ""} <li><a href="home.php?cat={$sc.categoryid}">{$sc.category}</a></li> {else} <li><a href="#" class="subexpandable">{$sc.category}</a> <ul class="subcategoryitems" style="margin-left: 15px"> {foreach from=$sc.subcats item=ssc name=ssc name=cm3} <li><a href="home.php?cat={$ssc.categoryid}">{$ssc.category}</a></li> {/foreach} </ul> </li> {/if} {/foreach} </ul>
__________________
X-Cart 4.1.9 | PHP 5.2.6 | MySQL 5.0.51a | Apache 1.3.51
Reply With Quote
  #2  
Old 09-28-2008, 10:06 AM
 
techspaces techspaces is offline
 

Advanced Member
  
Join Date: Aug 2008
Posts: 95
 

Default Re: category menu syntax

Bumping and clarifying. In the code above I'm looking for how to format
{foreach from=$c.subcats item=sc name=cm2}
{if $sc.subcats eq ""}
so it will only pull from a specific category number and it's subcategories instead of all categories.
__________________
X-Cart 4.1.9 | PHP 5.2.6 | MySQL 5.0.51a | Apache 1.3.51
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 03:29 PM.

   

 
X-Cart forums © 2001-2020