I have a series of sites that use the same theme. What I'm looking to achieve is to manage the main menu (or a standard menu) via a module instead.
Reasoning: Most of these sites will have the menu the exact same. If I need to change something, I would do it in the module. I could put it in the theme, but I'd rather the site admins not have control over appearance or to change the theme, have the ability to add to the menu if that have a small item that needs to be placed there, or the ability to simply not show the entire menu and manage their own.
I've tried the following, but every time the cache is cleared, a new item is added. If I change something, it just adds a new item and leaves the old one.
function something_mainmenu_menu() {
$items['external'] = array(
'title' => 'External Item',
'link_path' => 'http://www.whatever.com',
'type' => MENU_NORMAL_ITEM,
'menu_name' => 'main-menu'
);
}
Is this possible in Drupal as a module, or should I just put it in the theme and do a case based on the URL?