Hi everyone!
I'm working on a small module for my company intranet purposes, and one of the functions I need is an additional Menu Tab on specific node type right along with the View and Edit tabs. That particular tab (we'll call it Follow Up) should also have 2 submenu tabs available as well. Should look like this (assuming Follow Up tab is active):
| View | Edit | >Follow Up |
| >Automatic Campaigns | Letters|
But here is what I get:
| View | Edit | >Follow Up |
| >Automatic Campaigns | Letters|
| >Automatic Campaigns | Letters|
The buttons work correctly and everything is fine beside the fact that they are duplicated.
Here is my hook_menu() code:
<?php
function followup_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'admin/settings/followup',
'title' => t('Follow up settings'),
'description' => t('Select content type for the Follow Up.'),
'callback' => 'drupal_get_form',
'callback arguments' => array('followup_admin_settings'),
'access' => user_access('administer site configuration')
);
}else
{
$types_to_followup = variable_get('followup_nodetypes', array('leads'));
if (!$may_cache) {
if(in_array($node->type, $types_to_followup)){
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));