Hi all, i have a problem with DHTML menu.
It works fine but i will that when the home page is loaded all the menu are closed. In mine case one item is open from the beginning. I will all of them closed.

Can i do this?

My activeted menu effect in the admin panel are:
Animated sliding effect;
Keep only one menu open at a time;
For the above option, consider each menu tree separately;
Close menus when their parent menu is closed;

Thanks to all of you and sorry my bad english.

Comments

cburschka’s picture

Version: 6.x-3.2 » 7.x-1.x-dev
Category: support » feature
Status: Active » Postponed

Unfortunately, you can not currently prevent open menus from staying open when you reload the page. This is a feature that may be added in the version for Drupal 7.

rstryker’s picture

I think he might be saying that, no matter what he does -- even closing all the menus manually -- when the page is loaded, one item remains expanded.

That's what's happening to me. Thoughts?

lewpano’s picture

I really don't like what I did, but I'm in a hurry just to fix this. Well I replaced line 129:
if ($menu && !($in_active_trail || in_array(substr(key($stack), 5), $cookie)))
with
if ($menu && !(in_array(substr(key($stack), 5), $cookie)))
and it works for me, at least until now that I'm writing this post:)

Sorry for the undrupal attitude but this is an urgent circumstance for me. Later may be have more time to think about it.
Or may be someone else any other idea...?

rstryker’s picture

My issue seems to be more a bug with the core menu module, and not with DHTML Menu.

yakker’s picture

Not sure if this is the right place to put my 2c (apologies if not).

First - love this functionality - my deep thanks.

I am having a few problems that I can't seem to pin down. I am not a coder, by trade.

I have enabled DHTML Menu with the following settings:
Animated Sliding Effect
Close menus when their parent menu is closed
Go to the page on double-click.

What I want: default COLLAPSED state for all menus.
(just to start - I love that the menu can remember its state as you navigate from page to page).

My menu setup:

Primary Links

-Products (collapsible)
---Supplies
---Digital
---Photography

-Newsletter (collapsible)
---Classified
---Articles
---Archives

-Forums
-Classes

What I'm getting:

Firefox 3.08:
Normal predicted behaviour for every clicked link EXCEPT when navigating to the page.
When I do navigate to , the Products menu expands no matter what, while the Newsletter remembers its state.
There are no differences in settings on the menu admin pages for these items (the expandable checkbox is blank, all other settings identical except name and path and weight).

Safari 3.21:
Products menu always expands, no matter what link/page I navigate from or to.
The Newsletter does not remember its state when I navigate to , but it also 'forgets' when I navigate to some pages while it remembers at others (unpredictable).

Can't figure it out.
Not expecting anything, just thought I'd put it out there in case something rings a bell in someone's mind who knows WAY more about what they're doing than I do!
;)

Cheers!
Chris

rstryker’s picture

This sounds much like the behavior I was seeing: In Firefox and IE, one menu (the same menu) was always expanded, regardless of what its remembered state should have been. If I deleted that menu, another one would take its place as always expanded by default. But this behavior seemed to persist even when I disabled the DHTML Menu module, which means the bug must be with the core menu system.

I ended up having to trick the system by disabling (not deleting) the irritatingly-expending menu. Seemed to do the trick.

yakker’s picture

Interesting - I'll give it a try... I guess it just becomes the "dummy" menu... Cheers!

yakker’s picture

Title: Close all menus at start » Workaround - just in case
Version: 7.x-1.x-dev » 6.x-3.x-dev

DHTML menu seems to be working great right now (Jan 2009 6.3x -dev version).

I have two collapsible menus with few interspersed other links:

Link 1
Link 2
--Sub 1
--Sub2
--Sub3
--Sub4
Link3
--SubA
--SubB
--SubC
--SubD
Link4
Link5

If I disable Link 2 and all of it's sub-menu items, I start getting odd behaviour: Link 3 is ALWAYS expanded on the front page, regardless of its state on previous pages. However, if, in administration/menus I Drag Link 2 (and all its sub items) below all the rest of the links, normal behaviour returns.

So: if you have the Always-Expanded error, try creating a dummy menu with sub links, disable all of it and drag it to the bottom of your menu. The other option would be to redo the paths and names of your original menu (just in case this has something to do with mlid... I don't know enough about Drupal to know if this matters), disable it and drag it to the bottom, then recreate the "active" version where it used to be.

cburschka’s picture

Title: Workaround - just in case » Close all menus at start

Please keep the topic title meaningful.

cburschka’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Status: Postponed » Closed (duplicate)

A feature to disable the cookie is now included in the big feature patch for D7. It'll be some time before it gets into the release, of course.