I am fairly new to Drupal and still figuring out its inner workings. Currently, I am playing around with creating own modules. I want to create a tabbed menu via hook_menu and display it. Unfortunately, I seem to fail here. I lack the understanding how to activate the coded menu in the hook on one of my pages. Since I do not define a block (and with such have no hook block_info or block_view in my module), I am not able to place my module via the structure menu anywhere. And by itself, the tabbed menu does not show up anywhere. My module is available in the modules' list and I can activate and deactivate it. I also cleared all caches, but I can't seem to find it anywhere. Hence, my question is: how do I activate and place the menu on my site?
My module has the two files dummy_module.module and dummy_module.info.
dummy_module.module:
/**
* Implements hook_menu().
*/
function dummy_module_menu() {
$items = array();
$items['dummy'] = array(
'title' => 'dummy_module',
'page callback' => 'temp_output',
'access callback' => TRUE,
'weight' => 1
);
$items['dummy/new_tab1'] = array(
'title' => 'Current 1',
'type' => MENU_DEFAULT_LOCAL_TASK,
'page callback' => 'temp_output1',
'weight' => 2
);
$items['dummy/new_tab2'] = array(
'title' => 'Current 2',
'type' => MENU_LOCAL_TASK,
'page callback' => 'temp_output2',
'weight' => 3
);
return $items;
}
function temp_output() {
return 'Hello world!';
}
function temp_output1() {
return 'Hello world 1!';
}
function temp_output2() {
return 'Hello world 2!';
}
dummy_module.info:
name = Dummy Module
description = This is a dummy module and hence the basis for all further module development.
core = 7.x
files[] = dummy_module.module