I have two modules. Lets say they are called parent_module and child_module. I have hook_menu defined in both of them:

<?php
parent_module_menu()
{
  $menu['admin/parent'] = array
  (
    'title' => 'Parent',
    // menu declarations
  );
  return $menu;
}
?>
<?php
child_module_menu()
{
  $menu['admin/parent/child'] = array
  (
    'title' => 'Child',
    // menu declarations
  );
  return $menu;
}
?>

Now, I'm thinking that since the path in the child module is set as a sub-menu item of the path in the parent module, it should render them this way in the navigation menu. Like this:

Navigation menu:

Administrator
   Content Management
   Parent
      Child
   Site Building
   Site Configuration
   Reports
Log out

As you can see, the 'Child' menu item is a sub menu of 'Parent'. But instead they are rendering like this:

Administrator
   Content Management
   Parent
   Child
   Site Building
   Site Configuration
   Reports
Log out

Which makes no sense to me. I can't figure out how to make the sub menu render as a sub menu item.

I'm not looking for a way to do this through the admin interface - I know how to do that. I'm looking for a way to do this programmatically in my hook_menu() code. I'm thinking it may be a bug in hook_menu(), but I'm hoping someone can show me to be wrong.

Comments

jaypan’s picture

Edited original post.

Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.