Page 1 of 1
[SOLVED] Menu question: One navigation always expanded
Posted: Sun Oct 26, 2008 4:25 pm
by nils73
Hi everybody,
until now I only had navigations that used to expand the sub-items when clicked. Now I need a navigation where one part of the navigation is alwas expanded as such:
- One
- expanded-one
- expanded-two
- expanded-three
- Two
- Three
- Four
Just imagine that Two, Three and Four have also sub-elements that do only show up when you click on the parent element. However: One has to be kept open. Is there any way to achieve that with MenuManager? I can not use excludeprefix in this case or includeprefix for search-engine-reasons. Are there any alternatives? Maybe playing with alias or something like that? I have been looking through a lot of menu-templates but have not found any clue what to do now.
Regards,
Nils
Re: Menu question: One navigation always expanded
Posted: Tue Oct 28, 2008 8:45 am
by KO
Maybe one way would be to do it by CSS. With collapse=0 you could have all of the navi links open. Then if you add to you menutemplate to get alias printed on li class by {$node->alias}. Then with CSS you have the child ul open if it's parent li has "currentpage" "activeparent" or "page-alias-of-page-ONE".
Maybe does not work but just a thought.
Re: [SOLVED] Menu question: One navigation always expanded
Posted: Wed Oct 29, 2008 11:40 am
by nils73
KO, thank you for this great idea!
Solved it by applying "current" to the respective elements and by adding a simple if-statement to the menu itself. Now it works like it should and it is still dynamic. Great!
Regards,
Nils
Re: [SOLVED] Menu question: One navigation always expanded
Posted: Wed Oct 29, 2008 4:57 pm
by KO
nice!
Re: [SOLVED] Menu question: One navigation always expanded
Posted: Sat Nov 01, 2008 9:17 am
by nils73
Ah ... by the way: To be seen here at
Best of Accessibility, a german website about an accessibility event.
Thanks again for the help!
Re: [SOLVED] Menu question: One navigation always expanded
Posted: Fri Sep 18, 2009 6:53 pm
by gallowstree_merlin
Nils,
I have noted your post and what you have done is exactly what I would like to do.
Can you post specific details of the files you have modified to achive this effect.
Regards
Alan
Re: [SOLVED] Menu question: One navigation always expanded
Posted: Fri Oct 02, 2009 8:24 pm
by nils73
Here is what I did:
Code: Select all
[color=blue]
{if $count > 0}
<ul>
{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->current == true}
<li class="current"><h3><dfn>Aktuelle Seite ist {$node->hierarchy}: </dfn>{$node->menutext}</h3>
{elseif $node->parent == true}
<li class="current"><a class="active" href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>
{elseif $node->type == 'sectionheader'}
<li><strong class="section">{$node->menutext}</strong>
{elseif $node->type == 'separator'}
<li class="separator"><hr />
{else}
<li{if $node->alias == "boa2009"} class="current"{/if}><a 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 != ''} target="{$node->target}"{/if}><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}[/color]
Hope this helps.
Nils
Re: [SOLVED] Menu question: One navigation always expanded
Posted: Sun Oct 11, 2009 9:06 am
by gallowstree_merlin
Thanks Nils.
This will give me the logic I need to do the same for my navigation.
Alan