Would it be possible to have sub-menus be set to visible initially, if the menu parent is set to 'Expanded" in the menu Settings?
Would it be possible to have sub-menus be set to visible initially, if the menu parent is set to 'Expanded" in the menu Settings?
Comments
Comment #1
add1sun commentedI'm honestly not seeing where this would be useful. Dropdown and flyout menus are supposed to only show up when you hover. It isn't the same as a DHTML menu kind of thing. I'm really inclined to won't fix this since I've never seen a flyout menu set to expanded/open. Can you maybe explain a little more or show an example of a site that does this behavior?
Comment #2
GregFrench commentedThe reason for collapsed menus is obvious - to show only major menu items. and to reduce the visual impact of a large menus, with many sub-items. Too many Items make for difficult navigation.
However, there may be times when you want to show at least some of the sub-menu items. This could be some featured content. or indeed the main content of the site. The collapsed menus could be for less visited ares of a site, such as contact info or a support section, hidden to reduce clutter. This is, I'm sure, one of the primary reasons for having the 'expanded' option in normal menus the first place.
Sometimes the top menu item is there more as a label, to logically group items.
To be sure, I could get around this by creating separate menus, and only using Nice Menus where I want everything collapsed, but then I end up with different visual styles for the menus, and synchronizing the css would be a pain.
Comment #3
GregFrench commentedActually, there are a couple of other reasons I'm trying Nice Menus, unrelated to the drop down/flyout functionality.
First, I was looking for a way to avoid having to attach a node (or other URL) to a menu item. I found this: http://drupal.org/node/194596, which solved that problem, but disabled the ability to expand the menu. It does work with Nice Menus, however.
I also wanted to avoid having to load a page when I clicked on an item to expand the menu. Again, Nice Menus does this.
Comment #4
add1sun commentedUnfortunately I don't think this is a generally desirable feature for nice menus. If you write up the code to do this, please feel free to attach a patch but I most likely will not incorporate it into the module. It can be added to the handbook though if there happen to be other people who need this for some reason.
I still don't see the visual style of this making any sense with the flyout expanded. It sounds more like you want something like DHTML menu rather than nice menus.
Comment #5
GregFrench commentedYou're right, it would make no sense. DHTML menu it is.
Comment #6
dwightaspinwall commentedFirst, thank you for a nice module.
I think there's a valid need for expanded sub-menus in Nice Menus. You see this often, typical example at http://www.patagonia.com, where the Clothing and Gear menu has two levels of menu displayed in the same fly-out block (one for the high-level prduct category - men's, women's ,etc and the other for the lower-level category).
We have a similar need at my workplace, and are trying to figure out how best to implement. Deeply nested menus are cumbersome.
If there's an obvious alternative approach please do tell.
Otherwise, I could look into providing a patch. Thanks.
Comment #7
dwightaspinwall commentedDue to nice_menus' clean architecture, it was easy to provide a theming function which overrides nice_menus' theme_nice_menu_tree to expand children menu items. Basically, if the parent is expanded, then rather than wrap the children in a <ul></ul> block, the parent gets a class value of "expandedparent" (so you can style it differently if you wish) and the children end up as <li>'s in the same <ul> block as the parent. I also added an "item<n>" class value to support styling of each item in order (see the notes in the code on that one) as well as a "column<n>" for each menu item to be used by the css to support vertical shifting of the first <li> of each column. The technique is based on Method 6 in http://www.alistapart.com/articles/multicolumnlists, and is pure CSS based (the best of a bad bunch of options).
This code is not yet well tested; user beware. Meant to offer an approach.
Here's the theming function:
And the CSS:
Comment #8
jpdaut commentedDwight,
I'm having a hard time making the CSS work for me. Could you explain the ul#nice-menu-3.nice-menu and menu-path-community? Thanks.
Comment #9
jpdaut commentedOK I figured out the CSS.
There's still a problem with the Garland theme when the nice menus are in the header. Menu is all messed up in that case.
Does anyone know why and how to fix this?
Comment #10
add1sun commentedBecause Garland is weird. If you look in the NM CSS, you'll see a bunch of comments like "repeat for Garland" that include the same rule but add the specificity for the Garland header by leading with
#header-regionto make things look right in the Garland header.Comment #11
jpdaut commentedThanks. It works now (multi-column nice menu as per Dwight's above, header region, Garland), but there is a remaining issue.
We bring the first item of each column back up to the level of item 1 by counting #items * line-height, right? This calculation is indeed correct and should work perfectly. However 1 or 2 pixels difference show up in one or the other direction in browsers like Firefox, Safari and IE. So the columns' rows are not exactly lined up horizontally.
I would like to refrain using browser hacks, cumbersome and never completely right anyway.
So I am looking for another way to bring the first item of each column back to the level of item1, a way which would guarantee that everything lines up correctly. The calculation above is correct but yields incorrect results due to browser differences. We need something else, a CSS rule or something. Any ideas anyone?
Comment #12
jpdaut commentedStill trying to fix this.
Also looking at vince's multi-column implementation on http://drupal.org/node/301247 to see if it addresses the problem better.
Any ideas welcome.
Comment #14
kbeck303 commentedMenu Blocks Module might be another option
http://drupal.org/project/menu_block