Skip to main content

secondary menu

Drupal Menu: Add Primary Menu Parent to the Beginning of the Secondary Menu

Today I needed to take the parent menu item from my primary links and add it to the beginning of my secondary menu links. To begin, my menu structure looks like this:

  • Primary 1
  • Primary 2
    • Secondary 2.1
    • Secondary 2.2
    • Secondary 2.3
  • Primary 3

Default Menu Setup

The $main_menu variable will print a list item with:

  • Primary 1
  • Primary 2
  • Primary 3

When you click on the 'Primary 2' link the $secondary_menu variable will display: