Limmeting dropdown menu to top categorys and second level categorys

Hi I am trying to limit my drop-down category's to only show top and second level category's in the drop-down from top menu.



Can any one help me whit this?



i am lost and it looks so unprofessional that the drop down just keeps going.



and merry X-mas to you all



Joachim

In skins/your-skin/customer/views/categories/components/menu_items.tpl



Change:



  • {if $category.subcategories}




    To:



  • {if $category.subcategories && $category.level == "0"}




    That will make the emenu 1 level deep (main category > sub-category)



    You might be able to play around with the 0 and change it to 1 if you want to go in further.



    Hope that helps,



    Brandon

  • Thanks m8 i found an old post ware i piced togetter somthing you said and made the side category work.



    i still have som problems whit the top menu i can make it show only top level or all levels :-/

    this is the original code.


    ```php

    {* $Id: top_menu.tpl 9353 2010-05-04 06:10:09Z klerik $ *}



    {if $top_menu}


    {strip}



      {foreach from=$top_menu item="m"}


    • {$m.item}
      {if $m.subitems}
      {include file="top_menu.tpl" items=$m.subitems top_menu="" dir=$m.param_4}
      {/if}

    • {/foreach}

    {include file="common_templates/search.tpl"}


    {/strip}

     
    {elseif $items}

      {assign var="foreach_name" value="cats_$iter"}
      {foreach from=$items item="_m" name=$foreach_name}

    • {$_m.item}
      {if $_m.subitems}
      {include file="top_menu.tpl" items=$_m.subitems top_menu="" dir=$_m.param_4 iter=$smarty.foreach.$foreach_name.iteration+$iter}
      {/if}

    • {if !$smarty.foreach.$foreach_name.last}
    •  

    • {/if}
      {/foreach}

    {/if}
    ```


    to make it show only toplevel in drop down i dit this.

    ```php
    {* $Id: top_menu.tpl 9353 2010-05-04 06:10:09Z klerik $ *}
    {if $top_menu}

    {strip}


      {foreach from=$top_menu item="m"}


    • {$m.item}
      {if $m.subitems}
      {include file="top_menu.tpl" items=$m.subitems top_menu="" dir=$m.param_4}
      {/if}

    • {/foreach}

    {include file="common_templates/search.tpl"}


    {/strip}

     
    {elseif $items}

      {assign var="foreach_name" value="cats_$iter"}
      {foreach from=$items item="_m" name=$foreach_name}

    • {$_m.item}

    • {if !$smarty.foreach.$foreach_name.last}
    •  

    • {/if}
      {/foreach}

    {/if}
    ```

    but i cant seam to get it to show top and first level :-/