I have tried to get this question answered in the past, but I was never given a satisfactory response.
I am building a custom module. I do not want the module to inherit the current theme being used by Drupal core; it should have its own themes/templates. This is the code I have written.
myApp.module
// $Id$
require_once ('myApp.theme.inc');
function myApp_menu()
{
$result = array();
$result['myApp'] = array(
'title' => "My App",
'page callback' => "myApp_home",
'access callback' => true,
'type' => MENU_NORMAL_ITEM,
'weight' => 1,
);
return $result;
}
function myApp_home(){
$output = theme('myApp_home', array('data'=> ''));
return $output;
}
myApp.theme.inc
function myApp_theme() {
$path_to_theme = drupal_get_path('module', 'myApp')."/theme/";
$themes = array();
$themes['myApp_home'] = array(
'template' => 'myApp_home',
'path' => $path_to_theme ,
);
return $themes;
}
myApp_home.tpl.inc
<html>
<head></head>
<body>Hello World</body>
</html>
The problem is that the module still resides within the Drupal core. I want to have it be a full page web application.
I am new to this, so if anyone could provide an explanation of the best practice, and example code, I would really appreciate it.