2

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.

  • Do you use bootstrap theme? – MrD Jun 6 '16 at 6:44
0

$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).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.