View Single Post
  #2  
Old 09-04-2013, 03:44 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Fancy Categories Horitontal Menu Quesion

Here is some code I've been using for a client site.

horiz_menu.tpl
Code:
<div id="drop-down-menu"> <ul id="nav" class="dropdown dropdown-horizontal"> {assign var="loop_name" value="subcat`$parentid`"} {foreach from=$categories_menu_list item=c key=catid name=$loop_name} <li class="{$c.category|amp}{if $smarty.foreach.$loop_name.first} first{/if}"> <a href="home.php?cat={$catid}"{if $smarty.foreach.$loop_name.last} class="last"{/if}>{$c.category|amp}</a> {if $c.childs and $c.subcategory_count gt 0} {include file="customer/sub_menu.tpl" categories_menu_list=$c.childs parentid=$catid level=$level+1} {include file="customer/mega_menu.tpl" categories_menu_list=$c.childs parentid=$catid level=$level+1} {/if} </li> {/foreach} </ul> </div>
sub_menu.tpl
Code:
{assign var="loop_name" value="subcat`$parentid`"} <ul> {foreach from=$categories_menu_list item=c key=catid name=$loop_name} <li class="{$c.category|amp}{if $smarty.foreach.$loop_name.first} first{/if}"> <a href="home.php?cat={$catid}" class="{if $c.childs and $c.subcategory_count gt 0}dir {/if}{if $smarty.foreach.$loop_name.last}last{/if}">{$c.category|amp}</a> {if $c.childs and $c.subcategory_count gt 0} {include file="customer/sub_menu.tpl" categories_menu_list=$c.childs parentid=$catid level=$level+1} {/if} </li> {/foreach} </ul>
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote