Last updated 27 May 2010. Created on 25 October 2007.
Edited by VM, beanluc, add1sun, druvision. Log in to edit this page.


Being fairly new to Drupal I do not know how to find the $id and $pid parameters to make theme_nice_menu work on my site. Can you enlighten me?


The $id argument is the ID of the menu block you want to display. You may define how many different Nice Menus blocks, up to 10, in the settings at Administer > Site configuration > Nice Menus ( You can find the ID for a particular block you have created by going to Administer > Site building > Blocks ( and hovering over the "configure" link (e.g. The $id for the theme function is that end number.

The $pid argument is the identifier of the menu item which is the parent of the items you want to display. You may find a menu id by going to Administer > Site building > Menus ( and hovering over the edit link of the parent menu item which will end, again with a number (e.g., giving 10 as the $pid for the Create content menu.)

Calling the function
The function should be called using the theme function and may be called from either the template.php or directly in a template file (like page.tpl.php.)

This example is theming the Nice menu block ID of 1 and just the menu items that belong to the Create content part of the menu and setting the menu direction to down.

  $menu = theme('nice_menu', 1, 10, 'down');
  print $menu['content'];

Looking for support? Visit the forums, or join #drupal-support in IRC.