Search code examples
drupalmenubardrupal-7

Drupal 7, subpages not showing up


I have pages that I've organised to be under another main page but it isn't showing up under the secondary menu.

How do I get the secondary menu to display child pages of the current page?

Would there be a theme that does this already, i've tried zen and stark but they don't list the pages organised under the current page.


Solution

  • This sounds like a bug that I've run into myself: Custom menus never receive an active trail

    I've explained a workaround in a duplicate issue.

    To sumerize:

    The problem is that Drupal core active trail, breadcrumb and menu expansion only work for a set of core menus, defined as:

    $menus = variable_get(
      'menu_default_active_menus',
      array_keys(menu_list_system_menus())
    );
    

    There is no interface to change this, but you could do it in your settings.php and add the names of the menus you have created. Not a practically solution, but at least it works. You don't usually create new menus that often, so should be fine. An example of what to put in your settings.php file:

    $conf['menu_default_active_menus'] = array(
      'navigation', // Core menu
      'management', // Core menu
      'user-menu', // Core menu
      'main-menu', // Core menu
      'menu-products', // Custom menu
      'menu-custom-menu', // Custom menu
    );