Is it possible to create template file for custom module created page that override default page theme only when the path is visited?
The code i tried so far is displaying my custom module result inside default page theme content area. I want to display result in my self created template file content area. Is it possible?
function mymodule_menu(){
$items = array();
$items['mymodule'] = array(
'title' => 'Mymodule title',
'description' => 'Mymodule description',
'page callback' => 'mymodule_page',
'page arguments' => array(),
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
);
return $items;
}
function mymodule_theme() {
return array(
'mymodule_theme_page' => array(
'arguments' => array('mymodule' => NULL),
'template' => 'page-mymodule',
'path' => drupal_get_path('module', 'mymodule').'/template',
)
);
}
function mymodule_page(){
$mymodule = array('key'=>'Hello World');
$output = theme('mymodule_theme_page', $mymodule);
return $output;
}