Revision: 13514
Updated Code
at April 27, 2009 02:37 by level09
Updated Code
<?php function mymodule_menu() { $items = array(); $items['my-special-page'] = array( 'title' => 'This is my custom page', 'page callback' => 'my_special_page', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); return $items; } function my_special_page() { return theme('my_special_page'); } function mymodule_theme($existing, $type, $theme, $path) { return array( 'my_special_page' => array( 'arguments' => array('options' => NULL), 'template' => 'page-my-special-page', ), ); } // //replace the whole page function mymodule_theme_registry_alter(&$theme_registry) { $theme_hook = 'page'; // my hook name // Get the path to this module $modulepath = drupal_get_path('module', 'mymodule'); // Add the module path on top in the array of paths array_unshift($theme_registry[$theme_hook]['theme paths'], $modulepath); } ?>
Revision: 13513
Updated Code
at April 27, 2009 02:26 by level09
Updated Code
<?php function mymodule_menu() { $items = array(); $items['my-special-page'] = array( 'title' => 'This is my custom page', 'page callback' => 'my_special_page', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); return $items; } function my_special_page() { return theme('my_special_page'); } function mymodule_theme($existing, $type, $theme, $path) { return array( 'my_special_page' => array( 'arguments' => array('options' => NULL), 'template' => 'page-my-special-page', ), ); } //if you like to move the tpl to your module's dir (which is more practical) // then add the path to your tpl to the theme registry function mymodule_theme_registry_alter(&$theme_registry) { $theme_hook = 'page'; // my hook name // Get the path to this module $modulepath = drupal_get_path('module', 'mymodule'); // Add the module path on top in the array of paths array_unshift($theme_registry[$theme_hook]['theme paths'], $modulepath); } ?>
Revision: 13512
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 27, 2009 02:12 by level09
Initial Code
<?php function mymodule_menu() { $items = array(); $items['my-special-page'] = array( 'title' => 'This is my custom page', 'page callback' => 'my_special_page', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); return $items; } function my_special_page() { return theme('my_special_page'); } function mymodule_theme($existing, $type, $theme, $path) { return array( 'my_special_page' => array( 'arguments' => array('options' => NULL), 'template' => 'page-my-special-page', ), ); } function mymodule_theme_registry_alter(&$theme_registry) { $theme_hook = 'page'; // my hook name // Get the path to this module $modulepath = drupal_get_path('module', 'mymodule'); // Add the module path on top in the array of paths array_unshift($theme_registry[$theme_hook]['theme paths'], $modulepath); } ?>
Initial URL
Initial Description
Initial Title
Drupal Hook_Menu redirect to a themable tpl page
Initial Tags
page, drupal
Initial Language
PHP