Page 1 of 1

Help with menu manager

Posted: Tue Apr 21, 2015 9:10 pm
by cpansewicz
Hi,

I have a main menu on my site set-up to show 2 levels. I hope I can explain this well. I would like the menu to show 3 levels, but only for one menu item. Could somebody help me figure out how to accomplish this?

The template for my menu is:

Code: Select all

{if $count > 0}
<ul id="nav">
  {foreach from=$nodelist item=node}
  {if $node->depth > $node->prevdepth}
  {repeat string="<ul>" times=$node->depth-$node->prevdepth}
  {elseif $node->depth < $node->prevdepth}
  {repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
  </li>
  {elseif $node->index > 0}</li>
  {/if}
  {if $node->parent == true or ($node->current == true and $node->haschildren == true)}
  <li {if $node->menutext eq 'Ways of Giving'} id="gift"{/if} class="on">
    {elseif $node->current == active}
  <li {if $node->menutext eq 'Ways of Giving'} id="gift"{/if} class="on">
    {else}
  <li {if $node->menutext eq 'Ways of Giving'} id="gift"{/if} class="off">
    {/if}
  <a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>
          {if $node->hierarchy|count_characters < 4}<span>{/if}
          {$node->menutext}
          {if $node->hierarchy|count_characters < 4}</span>{/if}
          </a>
          {/foreach}
          {repeat string="</li></ul>" times=$node->depth-1}</li>
          </ul>
    {/if}
Basically what I would like is below:

>Item A (lists children)
>>Sub-Item A
>>Sub-Item B
>>Sub-Item C (list the children of Item C)

Thank you!

Re: Help with menu manager

Posted: Wed Apr 22, 2015 3:24 am
by JohnnyB
Is it possible to toggle on and off which pages you want to show in the menu (under the Options tab)? Then, when you have your level 1 and level 2 pages and the extra level 3 pages assigned to show in the menu, while all other pages are not assigned to show in the menu, you can use a regular old nested list menu template.

Re: Help with menu manager

Posted: Wed Apr 22, 2015 7:22 pm
by velden
I think it's possible to call the menu from inside the menu manager:

Code: Select all

{if $count > 0}
{* store this nodelist in a new variable *}
{$org_nodelist = $nodelist}

  {* use the new variable in the foreach loop *}
  {foreach from=$org_nodelist item=node}
   
     {$if node->alias == 'alias-of-menu-c'}
       {menu childrenof='alias-of-menu-c' template='other-menu-template'}
     {/if} 
   {/foreach}
...
    {/if}
Note the use of an extra variable to store the nodelist in. And note that therefore you should not use the exact same template for the 'submenu'. Why? Because the variables have a global scope, and calling the menu from inside this template will overwrite the original 'nodelist'. That could/will give strange problems.

Re: Help with menu manager

Posted: Thu Apr 23, 2015 4:19 pm
by cpansewicz
Yes, I would like to implement it that way. Thank you both for your ideas. I will play around with them.

On another note, is it possible to set-up a mega menu, like the attached image in CMS Made Simple?

Re: Help with menu manager

Posted: Fri Apr 24, 2015 5:13 pm
by Dr.CSS
Yes it is possible...

Re: Help with menu manager

Posted: Tue Apr 28, 2015 3:34 pm
by cpansewicz
Thank you!