I have a page.tpl.php in which has header , footer and content area. I need to load different content base on hook_menu from a module.
I am using the following test code in the module to try and print something from my template:
function my_module_theme() {
return array(
'tutorials_test' => array(
'template' => 'tutorial'
)
);
}
I have a template tutorial.tpl.php in the modules folder
The following is my hook_menu and the callback function
function my_module_menu() {
$items['insights/tutorials'] = array(
'title' => 'Tutorials',
'access callback' => TRUE,
'page callback' => 'insights_tutorials'
);
}
The callback function
function insights_tutorials() {
echo 'test';
print theme('tutorials_test');
echo 'after test';
}
When I turn to that page i can see the text 'test' and 'after test' but nothing from my template is printed.
tutorial.tpl.php has this simple code:
<h1>Hello World</h1>