Drupal 6: Custom Menu not Expanding when Parent (generated by views) is selected I have a Drupal 6.26 site with a custom menu like so:

-Category 1
--Page 
--Page
-Category 2
--Page
--Page
...


All Category pages are genrated by a view (e.g. sitename.com/intranet/category)

All pages that are children of each category are nodes. 

My primary problem is, when a category page is selected, the menu it's associated with doesn't expand. The site owner doesn't want the menus expanded by default. 

A secondary problem is the menu won't expand when one of the child pages is selected unless it has the path /intranet/category/*, which is not always desired.

Hopefully a bit of code can solve this issue.
Five lines of code placed in a views template file solved the issue:

 &lt;?php
    $path = drupal_get_path_alias(check_plain($_GET['q']));
    $menu_item = menu_get_item($path);
    $menu_item['href'] = $path;
    if($path &amp;&amp; $menu_item) {
      menu_set_item(NULL, $menu_item);
    }
  ?&gt;