[SOLVED] Menu question: One navigation always expanded

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

[SOLVED] Menu question: One navigation always expanded

Post 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
Last edited by nils73 on Wed Oct 29, 2008 11:39 am, edited 1 time in total.
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: Menu question: One navigation always expanded

Post 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.
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: [SOLVED] Menu question: One navigation always expanded

Post 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
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: [SOLVED] Menu question: One navigation always expanded

Post by KO »

nice!
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: [SOLVED] Menu question: One navigation always expanded

Post 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!
gallowstree_merlin
New Member
New Member
Posts: 8
Joined: Fri Aug 11, 2006 6:59 pm

Re: [SOLVED] Menu question: One navigation always expanded

Post 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
.... as we know, there are known knowns; there are things we know we know.

We also know there are known unknowns; that is to say we know there are some things we do not know.

But there are also unknown unknowns - the ones we don't know we don't know.

DR 12 Feb 2002
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: [SOLVED] Menu question: One navigation always expanded

Post 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
gallowstree_merlin
New Member
New Member
Posts: 8
Joined: Fri Aug 11, 2006 6:59 pm

Re: [SOLVED] Menu question: One navigation always expanded

Post by gallowstree_merlin »

Thanks Nils.

This will give me the logic I need to do the same for my navigation.


Alan
.... as we know, there are known knowns; there are things we know we know.

We also know there are known unknowns; that is to say we know there are some things we do not know.

But there are also unknown unknowns - the ones we don't know we don't know.

DR 12 Feb 2002
Post Reply

Return to “CMSMS Core”