I have created a menu tree two levels deep. On the second level some of the menu items link to a views page with arguments , ie,
products/audit-information where products is the location of the view and audit-information is the first argument. This argument is a term which is selected when creating a product node. There is at least one node of this type with this term and when i navigate to products/audit-information it appears. My problem is that even though i put products/audit-information as the path that the menu item links to when it is selected the parent branch of the tree collapses! I presume this is because it is a view, i did place menu item pointing to a real node with its own path in the same menu level and this does not collapse the tree, it stays open as expected.

Q > why does a view with an argument not keep the menu item active even when the views path is correct to the menu item ?

I am just using views 2.3 for Drupal 6x

Any leads welcome
thanks
JSP

Comments

Peter Kashpurenko’s picture

I have the same problem.
Help us please.

garyg’s picture

Any one has a fix for this.
Hello...

jdln’s picture

I have the same problem

jsims281’s picture

Same here, will post back if I find a solution.

This one seems kinda old! There must be a way to keep this bloody menu open... :)

I'm looking at
http://api.drupal.org/api/function/menu_set_active_menu_name/6
http://api.drupal.org/api/function/menu_set_active_item/6
http://api.drupal.org/api/function/menu_get_item/6

But I'm not sure if I've got the wrong end of the stick .

Is there something we can intercept to set what the current menu item is on page load?

jsims281’s picture

OK I found some sort of solution but it's not ideal.

1) Create a page in your menu that will "hold" your view
2) In your page put this

<?
$view_name = "my_view"; //the name of the view you wish to load
$arguments = array("argument1","argument2"); //the arguments you wish to pass to the view

print views_embed_view($view_name,'default',$arguments);
?>

3) Choose "PHP Code" as the input type

Now your page should load up the view, and because it is a page in the menu, it won't collapse.

I am still looking for a better solution and will post back if I find anything.

overaph’s picture

Hi jsims281,
I saw your method, but if i don't know the wrong, I have to make a page (with PhP code passing specific arguments ) for every view I have to do?

My menu structure is like:

menuParent (http://site/nameView)
      *menuChild (http://site/nameView/arg1)
              *menuChildChild (http://site/nameView/arg1/arg2)
              *menuChildChild2 (http://site/nameView/arg1/arg3)
      *menuChild2 (http://site/nameView/argX)
              *menuChildChild (http://site/nameView/argX/argXY)
...
...
...

I have other 30 item menu to add that call the same view with diferent arguments.
If I have to do a page (with php code) for every item-menu I will not use anymore the arguments in the view cause would be useless.

If I use Dhtml menu instead?

Anyone have try to use pathauto module? I suppose that changing the Url and setting an univoque link the item-menu would not be collapse.... but is only a supposition...

bye and thanks.
Sam