Page 1 of 1

Re: Use Menu Manager and Items List for multiple menus

Posted: Tue Mar 04, 2014 12:32 am
by JohnnyB
just add, items="home, about, services, products, my-account"
where those names represent the page alias:
;http://my-domain.com/about ===> "about" is the page alias

Re: Use Menu Manager and Items List for multiple menus

Posted: Tue Mar 04, 2014 9:38 am
by velden
I think you should start updating your cmsms installation to the most recent version.

About the menu:

I'd consider creating a slightly customized menu template; leave the opening and closing <div> and/or <ul> out. In the example below I've named it 'customtemplatename'.

Then create a page hierarchy:

Code: Select all

- general (section header)
  - home  (page)
  - about  (page)
- unit1 (section header)
  - page A
  - page B
  - ...
- unit2 (section header)
  - page D
  - page E
  - ...
- unit3 (section header)
  - page G
  - page H
  - ...
Then use two {menu} calls:

Code: Select all

<div id="menuwrapper">
<ul id="primary-nav">
{menu template='customtemplatename' childrenof='general'}
{menu template='customtemplatename' childrenof='unit1'}
</ul>
</div>
You could then create 3 templates, one for every business unit. Each with their own call to menu or think of some logic to dynamically find the current section header/parent.

There would also be a more static approach: hardcode the general menu items in the menu template. But that would mean an editor should not add or remove those general pages, nor change the alias of those. Thinking of it: you wouldn't easily know whether those static menu items are current page for styling etc. So don't think it's a good approach.

Code: Select all

{* CSS classes used in this template:
#menuwrapper - The id for the <div> that the menu is wrapped in. Sets the width, background etc. for the menu.
#primary-nav - The id for the <ul>
.menuparent - The class for each <li> that has children.
.menuactive - The class for each <li> that is active or is a parent (on any level) of a child that is active. *}

{assign var='number_of_levels' value=10000}
{if isset($menuparams.number_of_levels)}
  {assign var='number_of_levels' value=$menuparams.number_of_levels}
{/if}

{if $count > 0}
<div id="menuwrapper">
<ul id="primary-nav">

{* hard coded menu items at the beginning *}
<li>{cms_selflink page='home'}</li>
<li>{cms_selflink page='about'}</li>

{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
  ...
{/if}
{/foreach}
{repeat string='</li><li class="separator once" style="list-style-type: none;">&nbsp;</li></ul>' times=$node->depth-1}
</li>

{* hard coded menu items at the end *}
<li>{cms_selflink page='contact'}</li>

</ul>
<div class="clearb"></div>
</div>
{/if}