I am new to Drupal and would like to know the details of constant/global variable: $primary_nav Observed this variable is pulling list of links from a Menu with Title : "Main Menu" . I try to see the mapping of these in UI and DB, but could not find. Can you please help me to find out the mapping of this menu Name ( "Main Menu" ) with variable name : primary_nav and where is it defined.
1 Answer
$primary_nav
is template variable in Garland's template.php file. It's a variable specific to this Drupal core theme. The HTML markup is rendered by the theme_links()
.
The main argument to the theme function is page template variable $main_menu
, which is defined in theme.inc. This variable is set by menu_main_menu()
, which will retrieve a menu id setting then use that to look up data in the menu_links
table (noted by menu_name
column).