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

4.x DSEFU Switch Category Menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 09-09-2006, 03:04 PM
  girlsbits's Avatar 
girlsbits girlsbits is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 77
 

Default 4.x DSEFU Switch Category Menu

I'd post this hack to save others' some time. I've implemented it in 4.0.19, also certain it will also work in 4.0.18, perhaps somebody else can advise about previous versions of 4.x?

Anyhow, it presents the root category items as a vertical list, with each category seperated by a <HR>, and when you click on one of those root categories the sub-categories display underneath whilst loading the selected root category feature page. When you then click on another category, the current category "closes" and the newly clicked category feature page is loaded, and again the corresponding sub-cats are displayed.

* Thanks to Jon from Safetynetweb for adding the DSEFU links into this. *

Code:
{capture name=menu} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} {if $enable_seo_links == "Y"} <FONT class="CategoriesList"><A href="{seo_link cat_name=$categories[cat_num].category cat_id=$categories[cat_num].categoryid}" class="VertMenuItems">{$categories[cat_num].category}</A></FONT><BR><HR size="1" noshade class="CateMenuHr"> {/if} {else} <FONT class="CategoriesList"><A href="{seo_link cat_name=$categories[cat_num].category cat_id=$categories[cat_num].categoryid}" class="VertMenuItems">{$categories[cat_num].category}</A></FONT><BR><HR size="1" noshade class="CateMenuHr"> {/if} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {* SAFETYNET DSEFU MOD *} {if $enable_seo_links == "Y"} &nbsp;<a href="{seo_link cat_name=$allcategories[subcat].category cat_id=$allcategories[subcat].categoryid}" title="{$allcategories[subcat].category}" class="VertMenuItems">{if $cat eq $allcategories[subcat].categoryid}<B>{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}</B>{/if}</a><br> {else} &nbsp;<a href="home.php?cat={$allcategories[subcat].categoryid}" class="VertMenuItems">{if $cat eq $allcategories[subcat].categoryid}<B>{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}</B>{/if}</a> {/if} {* END SAFETYNET DSEFU MOD *} {/if} {/section} <HR size="1" noshade class="CateMenuHr"> {/if} {/section} {else} {section name=cat_num loop=$subcategories} {if $enable_seo_links == "Y"} <FONT class="CategoriesList"><A href="{seo_link cat_name=$subcategories[cat_num].category cat_id=$subcategories[cat_num].categoryid}" class="VertMenuItems">{$subcategories[cat_num].category}</A></FONT><BR><HR size="1" noshade class="CateMenuHr">{/if} {/section} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }
__________________
X-Cart Gold | v 4.0.18 | Unix | php 4.3 | phpMyAdmin 2.8.0.3 |
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


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 02:23 AM.

   

 
X-Cart forums © 2001-2020