X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Fancy Categories Horitontal Menu Quesion (https://forum.x-cart.com/showthread.php?t=67670)

liamb2001 09-03-2013 05:54 AM

Fancy Categories Horitontal Menu Quesion
 
Can anyone tell me how i can use the xcart built in flyout menu for the categories for a horizontal version at all please ?

Ive got this for my menu

<div id='cssmenu'>
<ul>
{assign var="loop_name" value="subcat`$parentid`"}
{foreach from=$categories_menu_list item=c key=catid name=$loop_name}

<li class="has-sub">
{strip}
<a href="home.php?cat={$catid}" class="has-sub">
{$c.category|amp}
{if $config.Flyout_Menus.icons_display_products_cnt eq 'Y' and $c.top_product_count gt 0}
({$c.top_product_count})
{/if}
</a>
{/strip}

{if $c.childs and $c.subcategory_count gt 0 and ($config.Flyout_Menus.icons_levels_limit eq 0 or $config.Flyout_Menus.icons_levels_limit gt $level)}
{include file="`$fc_skin_path`/subcategories.tpl" categories_menu_list=$c.childs parentid=$catid level=$level+1}
{/if}
</li>

{/foreach}
</ul>
</div>

And it works ok with my CSS i have in place but the drop down menu isnt appearing, id really appreciate any tips or help on this

totaltec 09-04-2013 03:44 AM

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>


liamb2001 09-04-2013 04:15 AM

Re: Fancy Categories Horitontal Menu Quesion
 
thanks for that mate, but when i apply the code to mine is seems blank

totaltec 09-04-2013 05:05 AM

Re: Fancy Categories Horitontal Menu Quesion
 
Well, I saw some mistakes and removed those, also cleaned it up and removed a div or two.

I am just posting this as an example of how I accomplished this. Try turning off cacheing for flyout categories and see if that helps.


All times are GMT -8. The time now is 06:49 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.