Page 1 of 1

[solved] How to achieve showing one set of children within the main menu?

Posted: Tue Jul 22, 2008 8:03 pm
by Jevos
What i'd want to achieve:

on a general area-page a menu looking like this (with the normal {menu}-tag in the template)
1.
2.
3.
4.
5.
  [children shown on hover]

on a specific area page (concerning an activity set as a link [menu-item 2.1] with children)
1.
2.
2.1.1
2.1.2
2.1.3
2.1.4
2.1.5
3.
4.
5.
  [all children still showing on hover]

What do i put in the template to achieve this?

Why do i want this? This way users get a content specific menu but the look and feel of the menu stay intact. The other option, to call the submenu below, above or outside the main menu, breaks the look of the site and the flow of the menu...

---
this question was previously posted regarding the fact that my first solution broke in IE6 - that has been clarified...

Re: How to achieve showing one set of children within the main menu?

Posted: Tue Jul 22, 2008 8:07 pm
by christiaans
Normally, I would've said; use the "collapse=1" addition to the menu tag, but I'm not 100% sure that'll work, since you want the menu subitems to show on hover.

I'll try it myself asap and let you know. Maybe mark has a genious solution before me though, as his wisdom is endless.

--

Just thought of another way it might work, by giving the "subitems" seperate classes. For instance, menu-subitem. Then use the following:

Code: Select all

{if $node->depth == 2}<li class="menu-subitem"><a href="#">Menu text</a></li>{/if}
in the menu manager template.

Re: How to achieve showing one set of children within the main menu?

Posted: Wed Jul 23, 2008 5:56 pm
by Jevos
i'll try your suggestion, but am curious what other solution you can come up with ;-)

Re: How to achieve showing one set of children within the main menu?

Posted: Wed Jul 23, 2008 8:14 pm
by Jevos
i fixed it in a roundabout way; created two new menu-templates where the id primary-nav has a slighly changed name. One template used before the split in the menu, up to a fixed element, one after the split from a certain element [thanks to Elijah Lofgren for his ideas in the menuManager wiki].

Then edited CSSMenu.js to include those id's in an array instead of the one fixed name and presto: http://www.arcana.nl/index.php?page=elerion-inleiding shows the result. Go to another actvity (items 3.1, 3.2 or 3.3) and a slightly different tenplate shows you the children of that activity's menu.

Cleaner suggestions without hacking the code appreciated but at least it's working... so you can see what the idea is...

Jevos