Page 1 of 1

Dropdown menu - repeat menu parent

Posted: Tue Jun 30, 2009 2:25 am
by mel
Hi,
One thing I found not simple in CMSMS is menu...
I have a dropdown menu on my site that working fine. But I want to change behavior of menuparent. For now, it have
Labo
Team->Ex
Both 3 pages are clickables and have unique content. But I will rather prefer this:
Labo
Team -> Team
              Ex

But I don't understand what I should change in template. I search on forum but I dont know how this is call.
Thanks so much if someone could help me.
Mel

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. *}
{if $count > 0}
<div id="menuwrapper">
<ul id="primary-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 class="menuactive menuparent"><a class="menuactive menuparent" 
{elseif $node->current == true}
	<li class="menuactive"><a class="menuactive" 
{elseif $node->haschildren == true}
	<li class="menuparent"><a class="menuparent" 
{elseif $node->type == 'sectionheader'}
        <li class="sectionheader"><span> {$node->menutext} </span>
{elseif $node->type == 'separator'}
        <li style="list-style-type: none;"> <hr class="separator" />
{else}
	<li><a 
{/if}
{if $node->type != 'sectionheader' and $node->type != 'separator'}
href="{$node->url}" {if $node->accesskey != ''}accesskey="{$node->accesskey}" {/if}{if $node->tabindex != ''}tabindex="{$node->tabindex}" {/if}{if $node->titleattribute != ''}title="{$node->titleattribute}"{/if}{if $node->target ne ""} target="{$node->target}"{/if}><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>
{elseif $node->type == 'sectionheader'}
><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>
{/if}

{/foreach}

	{repeat string="</li></ul>" times=$node->depth-1}		</li>
	</ul>
<div class="clearb"></div>
</div>
{/if}

Re: Dropdown menu - repeat menu parent

Posted: Tue Jun 30, 2009 4:42 am
by viebig
did you try adding a page as section header on top of each submenu?


For example, instead of:

Home -> Labor

use:

Home -> (Home)
              Labor

(Home) = Section Header page type


Regards

G

Re: Dropdown menu - repeat menu parent

Posted: Fri Jul 03, 2009 2:56 am
by mel
Hi,
It didn't work. It display as
Team-> Team>Team
             Ex

But this new section header is not clickable. I think it's that part:

Code: Select all

  <li class="sectionheader"><span> {$node->menutext} </span>
What I should add to render this as a link?  (just replace by span by doesn't work... :-[
Thanks,
Mel

Re: Dropdown menu - repeat menu parent

Posted: Fri Jul 03, 2009 6:37 am
by Jeff
If you want it to be clickable, then change it to an internal link instead of a section heading.

If I understand your original page structure was:

2.      labo -- Page
2.1    team -- Page
2.1.1  Ex  -- Page

try page structure like:

2        labo -- Page
2.1    team -- Internal Link to 2.1.1
2.1.1  team -- Page
2.1.2  Ex -- Page

Re: Dropdown menu - repeat menu parent

Posted: Wed Jul 15, 2009 2:46 am
by mel
Hi
Sorry for long delayed answer. It's works with internal page. Initially, it was'nt my first choice as it give a lot of typing (I use multi-language version). But it's fine.
But I try to add a separator between 2.1 and 2.1.1. but i couldn't see it on frontend. It never appear where it should be. I try to style it with .separator but no luck...
Thanks ;-)
Mel

Re: Dropdown menu - repeat menu parent

Posted: Wed Jul 15, 2009 4:56 pm
by viebig
great! add [solved] to the subject

Regards