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

NEW - Sub-Category Display

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-13-2003, 02:57 PM
 
rodneyw rodneyw is offline
 

Senior Member
  
Join Date: Mar 2003
Posts: 162
 

Default NEW - Sub-Category Display

ok, been working on having the sub-categories display in a drop down menu.

I've actually got it working, it's not real 'pretty' yet but seems to work. What I can't seem to get is to display the current category image only.

here's the code if anyone is intrested in using it or helping me

Code:
{* $Id: subcategories.tpl,v 1.32 2003/04/24 09:50:33 svowl Exp $ *} { include file="location.tpl" } {if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"} {include file="modules/Bestsellers/bestsellers.tpl"} {/if} {literal} <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- function switchpage(select) { // JavaScript function for switching to web page when user // selects option from the given list box. var index; for(index=0; index<select.options.length; index++) if(select.options[index].selected) { if(select.options[index].value!="") window.location.href=select.options[index].value; break; } } // --> </SCRIPT> {/literal} { include file="customer/main/navigation.tpl" } {if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":" "} {/if} {capture name=dialog} {assign var="tmp" value="0"} {section name=cat_num loop=$subcategories} {if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if} {/section} {if $tmp} <SELECT NAME="url" onchange="switchpage(this)"> <OPTION VALUE=""> Choose Subcategory</option> {section name=cat_num loop=$subcategories} <OPTION VALUE="home.php?cat={ $subcategories[cat_num].categoryid }"> { $subcategories[cat_num].category_name|escape }</option> {/section} </SELECT> {else} {/if} <br clear=_all><hr size=1 noshade> {include file="customer/main/products.tpl" products=$products} {if $products eq "" and $tmp eq "0"} {$lng.txt_no_products_in_cat} {/if} {/capture} {include file="dialog.tpl" title=$current_category.category_name|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
  #2  
Old 09-14-2003, 03:39 PM
 
Mad Mad is offline
 

Advanced Member
  
Join Date: Jul 2003
Location: Brooklyn, NY
Posts: 60
 

Default

Got a sample somewhere of how it looks and acts at the moment? Sounds really interesting!
Reply With Quote
  #3  
Old 09-14-2003, 04:57 PM
 
rodneyw rodneyw is offline
 

Senior Member
  
Join Date: Mar 2003
Posts: 162
 

Default

no, but I will put it up somehwere and let you take a look.

It's just a normal drop-down menu that will display each sub-category that is with in THAT category..IF there are sub-categories present. If not, it won't display.

Select the sub-category and a javascript takes you to that sub-category. It will go as deep as you have levels of categories
Reply With Quote
  #4  
Old 09-16-2003, 07:23 AM
 
MiguelS MiguelS is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 36
 

Default

Is there anyway to call the categories list from a different area, because that code only works in the actual subcategory. For example say i have:

CATEGORIES:
Category1 <--- Subcategory1a, Subcategory2a, Subcategory3a
Category2 <--- Subcategory1b, Subcategory2b, Subcategory3b
Category3 <--- Subcategory1c, Subcategory2c, Subcategory3c

And i put that code inside on the main page it will list Category1, Category2, and Category3, if i put it directly under Category1 it will display Subcategory1a, Subcategory2a, Subcategory3a right?

Is there a way I can have something where it will call a specific subcategory list from the main page, where i can put that code directly under the main page, but i want it to list all the subcategories of category1?
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 02:00 PM.

   

 
X-Cart forums © 2001-2020