Submenu levels to always show > 1

Talk about new features for CMSMS and modules.
Post Reply
meanpenguin
Forum Members
Forum Members
Posts: 14
Joined: Thu Mar 01, 2007 3:14 am

Submenu levels to always show > 1

Post by meanpenguin »

Using the Simple Menu template, all is good except I need one more feature

The ability to always show 2 levels of the menu on the right side bar.

Using

{menu template='simple_navigation.tpl' start_level='2' number_of_levels='3 collapse="0" }

Shows two levels of menus but clicking on any of the menus will not expand the children.

I need something like min_levels_to_show option.

Thank You,
Edward
cyberman

Re: Submenu levels to always show > 1

Post by cyberman »

Hmm, dont know if I'm understand right ... but if you want something to expand think collapse must be 1  ::).
meanpenguin
Forum Members
Forum Members
Posts: 14
Joined: Thu Mar 01, 2007 3:14 am

Re: Submenu levels to always show > 1

Post by meanpenguin »

Currently the menus on the left side show 1 level of menus

Topic1
Topic2
Topic3


I would like it to show two levels

Topic1
  Sub topic 1A
  Sub topic 1B
  Sub topic 1C
Topic 2
  Sub topic 2A
Topic 3
  Sub topic 3A
  Sub topic 3B
  Sub topic 3C
  Sub topic 3D


Clicking on Sub topic 1B would make the menus under 1B to expand

Topic1
  Sub topic 1A
  Sub topic 1B
      1B Item 1
      1B Item 2
      1B Item 3
  Sub topic 1C
Topic 2
  Sub topic 2A
Topic 3
  Sub topic 3A
  Sub topic 3B
  Sub topic 3C
  Sub topic 3D


Thanks,
Edward
User avatar
chead
Forum Members
Forum Members
Posts: 63
Joined: Tue Feb 06, 2007 4:01 am
Location: Dallas, TX

Re: Submenu levels to always show > 1

Post by chead »

Take a look at the custom menu templates called menu_icon_expand and section_expand in the wiki; I think they're close to what you're looking for.

User_Handbook/Admin_Panel/Layout/Menu_Manager
meanpenguin
Forum Members
Forum Members
Posts: 14
Joined: Thu Mar 01, 2007 3:14 am

Re: Submenu levels to always show > 1

Post by meanpenguin »

Can someone add this into the code base...for the MenuModule to support minimum levels of menu items to show.

In file action.default.php

Replaced
if (isset($params['number_of_levels']) && $params['number_of_levels'] == '1')
    $getchildren = false;


with
if (isset($params['number_of_levels']) && $params['number_of_levels'] == '1'
    && isset($params['min_levels']) && $params['min_levels'] == '1')
    $getchildren = false;



In file MenuManager.module.php

Added last 1 line
    function SetParameters()
    {
        $this->CreateParameter('collapse', '1', $this->lang('help_collapse'));
        $this->CreateParameter('items', 'contact,home', $this->lang('help_items'));
        $this->CreateParameter('number_of_levels', '1', $this->lang('help_number_of_levels'));
        $this->CreateParameter('min_levels', '1', $this->lang('help_min_levels'));


Added last 4 lines
if (!(isset($params['number_of_levels']) && $newnode->depth > ($params['number_of_levels']) - ($origdepth)) && (count($showparents) == 0 || (count($showparents) > 0 && in_array($content->Hierarchy() . '.', $showparents))))
{
    $this->GetChildNodes($onechild, $nodelist, $gCms, $prevdepth, $count, $params, $origdepth, $showparents);
}
elseif ((isset($params['min_levels']) && $newnode->depth GetChildNodes($onechild, $nodelist, $gCms, $prevdepth, $count, $params, $origdepth, $showparents);
}
Post Reply

Return to “Feature ideas”