Placing Menus on Your Pages

So you're all up to speed on how to create menus, how to fill them with menu items that link to content, and how to otherwise sculpt those menus to your liking. Great. Now, how about having those menus actually report for active duty and show up on your site?

Displaying menus in general

Drupal's basic policy for handling display of menus is to make each one a block. From there, display is a simple matter. Head to the Blocks administration form:

Navigation » Administer » Site building » Blocks

Among all of your site's blocks listed there, you should see a separate block for each menu you've created. Just follow the standard procedures for displaying a block, and slap that menu onto pages just where you want it. Like any other block, you can choose from among several locations ("regions") on the page to hold the block, set its order among any other blocks displayed in the same region, and even set details such as having the block only appear on certain pages or for certain user roles. Flexible and easy.

See Working with Menus: Administration Form and Working with Blocks for all the grit and grease. 

Displaying special menus

As discussed in Working with Menus: Administration Form, Drupal offers special treatment for a few menus. See that page, and the notes below, for the extra detail you need to know for those. It's nothing difficult:

Navigation menu

You'll recall that this is the menu Drupal automatically creates for authenticated users. Drupal populates it with the menu items a user needs for all of his permitted tasks: create content, edit his account info, whatever he's allowed to do. 

The Navigation menu appears as a block, like any other menu. The only special concern is this: As the Navigation menu is the one users need to handle user-related tasks, you probably want to make sure it's enabled and readily visible to users. In particular, it's your main tool as site administrator, so think twice before removing it from your pages! 

(If you do deactivate the Navigation menu and desperately want it back, don't panic; you can easily get back to the Blocks administration form at the URL <your site domain>/admin/build/block . Go there and make the Navigation menu visible again.)

Primary links menu

As discussed earlier, most Drupal Themes offer a special location for displaying a "main menu" of your most important links, typically in a horizontal line near the top of all pages. You can select which of your menus gets this 'Primary links menu' designation. (Drupal automatically offers one such candidate menu, suggestively titled 'Primary links', though you don't have to choose that one.)

The point of note: Setting a menu as the special 'Primary links menu' doesn't remove its existence as a normal block. It'll still be available in your list of blocks, which you can choose to place in any of the regions normally available for block placement. 

Secondary links menu

Also as discussed earlier, many Drupal Themes also support special display of a 'Secondary links menu', typically a second row of links underneath the special 'Primary links menu' links. You can choose which menu, if any, to designate for this special display.

The point of note here is the same as above: Designating a menu as your 'Secondary links menu' doesn't remove its existence as a normal block. You can still choose to place it as a block somewhere on the page.

Lots of choices

You can see that Drupal offers fairly flexible options for placing menus on your pages. For a specific menu, you can choose to not have it appear at all, or to appear as a block in a region of your choice, or to appear in the special 'Primary links' location, or to appear in the special 'Secondary links location', or to appear in one of those two special locations and appear as a block somewhere. For menus appearing as blocks, you can also (as with any other block) set the menu to appear only for certain user roles, and/or only on certain pages. 

That's a lot of possibilities! Just set something simple at first, and play with more detailed options as you come across the need. 


sayed ali's picture

thank you so much for your valuable efforts regarding delivering the knowledge of the strong man Drupal .

actually i am looking to get some details about how to employ our php knowledge in creating drupal module . that would be



thank you


sayed ali  - Egypt - Cairo

Add new comment