[resolved] sub-menu with parent

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
tynmar

[resolved] sub-menu with parent

Post by tynmar »

Hi,

I didn't find the solution to show the parent menu in a submenu.

For example, this is my hierarchy :
- Menu 1
- Menu 2
  - Menu 2.1
  - Menu 2.2
  - Menu 2.3
- Menu 3
  - Menu 3.1
  - Menu 3.2
  - Menu 3.3
etc...

I want to show a menu with the first current level (for example "Menu 2") and all the child menu, i.e. :
menu 2 | menu 2.1 | menu 2.2 | menu 2.3

And when I'm on the Menu 3, this is switched on :
menu 3 | menu 3.1 | menu 3.2 | menu 3.3

thanks a lot
Last edited by tynmar on Mon Jan 15, 2007 10:29 am, edited 1 time in total.
cyberman

Re: sub-menu with parent

Post by cyberman »

You have to add parameter collapse='1' to menu command :).
tynmar

Re: sub-menu with parent

Post by tynmar »

Ok, but when I'm on the menu 2, it shows me :
menu 1 | menu 2 | menu 2.1 | menu 2.2 | menu 2.3 | menu 3 | etc ...

And i just want to see menu 2 and its children when I'm on menu 2.
tynmar

Re: sub-menu with parent

Post by tynmar »

It's OK, I modified the template with {if} I did what I wanted.  :D
c_head

Re: [resolved] sub-menu with parent

Post by c_head »

Make a new menu template just for the Level 1 header above your side menu. Use code like this:

{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->current == true or $node->parent == true}
{* ADD WHAT YOU WANT TO DISPLAY AS A HEADER HERE *}
{/if}
{/foreach}
{/if}


In this menu template, replace the comment line with the HTML/Smarty code that displays what you want in your menu header. You can make your own, or just copy/paste from your side menu template.

Then, in your page template, add {menu start_level ='1' number_of_levels='1'} just before your side {menu}. That's it.
Locked

Return to “Modules/Add-Ons”