Hello

Please pleeeeeaaaase heeeeeeelp!
I'm getting into Drupal and started to really like it, but now I'm losing my hair here trying to build the menu. :-(

What I want to do, is creating a proper (2-level)menu structure and from there give the users access to different pages functions. But with functions like "add" or "search" it doesn't work.
For example, following menu:
----------------
Home
About
Discussions
> New Discussion

----------------

Now I want "New Discussion" to link to "node/add/forum". It works, but the submenu doesn't stay open, it disappears!

I have the same issue with node/add/audio or search/audio , etc.

How can I fix this?

Please help me, I can't find a solution and am desperate...

Comments

globetrotter’s picture

nobody? :-(

globetrotter’s picture

Luckily I was able to ask an expert about this issue and got an answer. Here an excerpt from the emails:
------------------------------
Question:
>....
>It's about building a nice menu for a site where we have different
> functionality. Some from normal modules, some from custom modules. So
> what I want to do is creating menu points where the user can open a
> specific page/function. For example the menu point Music/search should
> point to the function search/audio. I can create a menu and point it to
> the URL search/audio but then Drupal doesn't recognize the menu path and
> closes the submenu and doesn't highlight the Parent Menu Point (Music).

Answer:
...
This is a design issue with the drupal menu system. Drupal draws the
menu and it's children only if one of the children is active. in your
case the link "New Discussion" points drupal to a menu item which is
already taken and being handled by a module, in this case it's the node
module. So when you go to this link Drupal automatically switches to the
current active menu item which is not under your created menu. It's a
bit confusing actually. Right now I'm working on a fix for this
particular issue because it's ruining one of my clients' navigation
tree. Right now you have 2 options, the first is to go into your theme
file template.php and check if the current menu is one of the links you
wanna keep active and then use the function menu_set_active_item() to
fool drupal into thinking that the currently active menu item is under
your manually created menu tree. For example in your case you can do this:

theme_page($content) {
if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'forum') {
menu_set_active_item('Discussions');
}

return phptemplate_page($content);
}

or you can wait till I figure out a more usable less hackish way to do
this in drupal 5