hook_menu() and collapsable menu items with wildcard I've defined a few routes with hook_menu(), and added these routes to a menu with nesting. This works fine for all static routes, but for any route with a wildcard the 'active-trail' does (understandably) not apply to the menu, and the parent menu item is collapsed. How can I enforce that the parent menu item is open and has 'active-trail' class?

This is the hook_menu() implementation I am using.

function my_module_menu() {
  $items['parent'] = array(
    'title' =&gt; t("Parent"),
    'page callback' =&gt; 'my_module_parent',
    'access callback' =&gt; 'user_is_logged_in',
  );
  $items['parent/child'] = array(
    'title' =&gt; t("Child"),
    'page callback' =&gt; 'my_module_child',
    'access callback' =&gt; 'user_is_logged_in',
  );
  $items['parent/child/%'] = array(
    'title' =&gt; t("Child Item"),
    'page callback' =&gt; 'my_module_child_item',
    'access callback' =&gt; 'user_is_logged_in',
    'page arguments' =&gt; array(2)
  );

  return $items;
}


My menu (a custom menu) looks like the following.


Home


Item 1
Item 2
Parent


Child




So if I go to 'parent/child/123' I want the 'parent' and 'child' menu items to be active and not collapsed. 

I've tried the Menu Trail by Path module, but it seems to have no effect.
I solved the problem with the Link Trail By Path module. This module add active class for 'parent' and 'child' link.