Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between MENU_NORMAL_ITEM and MENU_CALLBACK?

Tags:

drupal

What is the difference between MENU_NORMAL_ITEM and MENU_CALLBACK?

like image 519
whitefang Avatar asked Jul 21 '10 12:07

whitefang


2 Answers

The more precise answer is that hook_menu() creates router items, and also menu links are generated. MENU_NORMAL_ITEM generates a menu link which will appear in the navigation menu, while MENU_CALLBACK does not add a menu link, so it won't appear in the menu.

like image 150
chx Avatar answered Oct 13 '22 05:10

chx


Addition to the above comment, MENU_CALLBACK can be used in some scenarios such as AJAX. Example: example.com/ajax/country_list is a MENU_CALLBACK which returns a list of countries in HTML,JSON or XML format... This menu doesn't appear in the browser. You can visit http://api.drupal.org/api/group/menu/6 for more information.

like image 29
Tuong Le Avatar answered Oct 13 '22 04:10

Tuong Le