Skill Level: 
Advanced

Requires Context UI and Menu Block modules enabled.

This tutorial walks through the process of setting up a site with sections of that site (subsites) having different sets of links appear in the navigation section and move the default selected breadcrumb accordingly.

Example of subsite

The example above shows the default Main menu block in the Navigaiton region of the Business & Finance homepage and the Main menu of the Human Resources "sub site" that has its own navigation and defaults the selected breadcrumb to Human Resources rather than Business & Finance.

(The following example is merely one method of accomplishing sub site navigation.  In this example the sub site menus are housed in a different Drupal menu than the main site navigation.  Rather than this approach you could stick to using a single menu - the "Main menu" - and use branches of its tree on the subsites using a similar setup as what is outlined below.)

1. Create a new menu on admin/structure/menu.  This menu will house any and all sub menus you will use.  Give it a title such as "Department Menu".  Its structure will look like:

  • Facilities
    • Management & Operations
    • Planning & Construction
  • Financial Services
  • Human Resources
  • ...

2. Create a new menu block (+ Add menu block) on admin/stucture/block

  • Give it titles such as "Department Sub Menus"
  • Menu: Department Menu (name from step 1)
  • Starting Level: 2nd level (secondary)
  • Maximum depth: 2
  • Don't assign it to a region - we'll use Context for that below.

3. Create a new Context (admin/structure/context) for each sub site you have. The following Conditions are examples, you may have to do something different to properly "target" the pages you want.  All of the Reactions are required.

  • Conditions:
    • Path:
      humanresources/*
      humanresources
      
    • -or- Menu: Select "Human Resources" in Department menu
  • Reactions:
    1. Blocks: Add "Department Sub Menus" to Navigation Links (If you don't see this option clear the site cache)
    2. Block Remove: type "main-menu" without the quotes
    3. Breadcrumb: Benefits
    4. link rel="home" tag: Enter full URL of the Human Resources link in the menu

Going Forward: Editing the Navigation

After this is setup, a navigation link is edited in different ways depending on if it is in the main navigation or a subsite navigation. Remember, a page may appear in both menus or just one.

  • Editing a subsite navigation link (Figure 2): Go to admin/structure/menu and click "list links" next to Department Menu. There a link can be added, edited, or moved.
  • Editing a link in the main menu (Figure 1):
    • Can be done in the menu editing section at admin/structure/menu/manage/main-menu or
    • Can be done directly on the edit interface for that page under the "Site hierarchy" tab at the bottom

The "Site hierarchy" tab on the page editing interface is only used for manipulating the page's link in the Main menu navigation. Editing links in subsite navigation must be done on admin/structure/menu.

Contributed By: 
IIM