I want to override the following part of code in "Contact" module which is located in hook_menu so that the type of item changes to MENU_NORMAL_ITEM instead of MENU_SUGGESTED_ITEM.

    $items['contact'] = array(
    'title' => 'Contact',
    'page callback' => 'contact_site_page',
    'access arguments' => array('access site-wide contact form'),
    'type' => MENU_SUGGESTED_ITEM,
    'file' => 'contact.pages.inc',
  );

I wrote anther module named "Advanced contact" to override this using hook_menu_alter

function advanced_contact_menu_alter(&$callbacks){
}

Now I don't know how to use $callbacks parameter to change the type to MENU_NORMAL_ITEM. What is your opinion?
Thanks in advance.

Comments

j_ten_man’s picture

function advanced_contact_menu_alter(&$callbacks){
  $callbacks['contact']['type'] = MENU_NORMAL_ITEM;
}

Be sure to flush the menu cache or else you will not see this change.

MDF-2’s picture

thanks,
I tested your code and cleared the cache, but it does not work, the "Contact" item in navigation menu is still hidden.
What is the problem ?

prakashp’s picture

You can just enable the 'Contact' menu item by going to 'admin/build/menu-customize/navigation' i.e.
Administer > Menus > Navigation

From your post it seems that is what you want.