Menu that shows siblings only

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Guy001

Menu that shows siblings only

Post by Guy001 »

Hi,

Has anyone managed to make a menu that shows only the current page and siblings of that page?

I think it's possible with Ellnav but Im finding Ellnav very buggy so would prefer to use the new Menu Manager if possible.

Mucho appreciato.
genassist

Re: Menu that shows siblings only

Post by genassist »

Did you (or anyone else) get anywhere with this? I have the same requirement, if someone else has come up with something, it would be useful..

Thanks..
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Menu that shows siblings only

Post by Ted »

Menu Manager does this now.  The Split Menu page in the default site shows it working.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Menu that shows siblings only

Post by Dr.CSS »

in the help for menu manager under Extensions » Modules

    * (optional) template="bulletmenu.tpl" - The template to use for displaying the menu. Templates will come from the database templates unless the template name ends with .tpl, in which case it will come from a file in the MenuManager templates directory
    * (optional) start_page="home" - Starts the menu displaying at the given start_page and showing that element and it's children only. Takes a page alias.
    * (optional) start_element="1.2" - Starts the menu displaying at the given start_element and showing that element and it's children only. Takes a hierarchy position (e.g. 5.1.2).
    * (optional) start_level="2" - This option will have the menu only display items starting a the given level. An easy example would be if you had one menu on the page with number_of_levels='1'. Then as a second menu, you have start_level='2'. Now, your second menu will show items based on what is selected in the first menu.
    * (optional) show_root_siblings="1" - This option only becomes useful if start_element or start_page are used. It basically will display the siblings along side of the selected start_page/element.
    * (optional) number_of_levels="1" - This setting will only allow the menu to only display a certain number of levels deep.
    * (optional) items="contact,home" - Use this item to select a list of pages that this menu should display. The value should be a list of page aliases separated with commas.
    * (optional) collapse="1" - Turn on (set to 1) to have the menu hide items not related to the current selected page.
    * (optional) lang="en_US" - Parameter is used to specify what language to use for display on the frontend. Not all modules support or need this.

  HTH
          mark
genassist

Re: Menu that shows siblings only

Post by genassist »

OK, in my navigation element in my template:-

{cms_module module='menumanager' collapse='1' start_level='2' showtoplevel='0'}

Which shows the respective child pages for that section. Exactly what I wanted.

Thanks for your direction.
urbanroute

Re: Menu that shows siblings only

Post by urbanroute »

This should be very simple to do but I haven't figured it out yet nor have a I seen this posted before:

I have a menu with child elements and I want to start / expand one menu but still show the other parent menus:

Menu 1
Menu 2
    Menu 2.1
    Menu 2.2
Menu 3
Menu 4

Seems all the optional parameters allow you to start somewhere but then only show that menu item and it's child elements. IE:

{menu template='simple_navigation.tpl' collapse='1' start_element='2'}

Will only show

Menu 2
    Menu 2.1
    Menu 2.2

But what about showing all Menus 1, 3 and 4?

Thanks for the help.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Menu that shows siblings only

Post by Dr.CSS »

The one you want is like the first page in a default install... {menu template='simple_navigation.tpl' collapse='1'}
urbanroute

Re: Menu that shows siblings only

Post by urbanroute »

Thank you for your speedy reply!

That's what I have right now, I don't think I wrote my question properly.

By deafault (when I first load the site / or click on the home page) I would like the first menu item to be expanded. So it looks like:

Menu 1
Menu 2
    Menu 2.1
    Menu 2.2
Menu 3
Menu 4

Right now I get that expansion only if I click on Menu 2. The reason is that the default display of:

Menu 1
Menu 2
Menu 3
Menu 4

Does not look inviting as opening a Menu for the visitor to start looking around.

Thank you again for your help, is there a way to do this?

Best Regards,
Ryan
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Menu that shows siblings only

Post by Dr.CSS »

If you have no other children, or don't care if they show also you can take out the collapse="1" part of the menu tag...

If you have other child items but don't want them expanded then you will have to target 2.1 & 2.2 individually to be expanded...
urbanroute

Re: Menu that shows siblings only

Post by urbanroute »

Thanks again for the reply and help.

I need a little more direction to get through my newbie head.

I have many child elements in the site that look like this:

1

2
2.1
2.1.1
2.1.2

3
3.1
3.1.1
3.1.2
3.2
3.3

4

Right now I am using collapse="1" without any other parameters so it looks like this:

1
2
3
4

... and not inviting, so I want to expand one menu by default to show it's child menus, like so:

1

2
2.1
2.1.1
2.1.2

3
4

I think I've tried every optional parameter but they all seem to give you all or nothing IE: I can get menu 2 and it's children to show when I open the site up, but then menu 2 is the only thing showing. If  I specify all menu items to show, then they show out of their hierarchy.

When you say Target specific elements I tried using includeprefix and or items parameters but they did not work as I would like.

Many thanks,
Ryan
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Menu that shows siblings only

Post by Dr.CSS »

You will have to make a copy of the menu template and add {$node->alias} to it and then in CSS add display:block to those page alias' a bunch of other stuff that is beyond the scope of an answer here...

sorry...
urbanroute

Re: Menu that shows siblings only

Post by urbanroute »

I wasn't sure if this was an easy task or not, looks like it's more involved then just using a optional parameter. I also assumed someone else has tried this before but I guess I'm wrong on that one too.

Thanks for your help. I'll leave it the way it is until I have some to figure it out using a custom template.  8)

Ryan
Locked

Return to “CMSMS Core”