eristoddle
10/16/2012 - 6:34 PM

Drupal Module Function for Overriding Theme Templates from the Module

Drupal Module Function for Overriding Theme Templates from the Module

/**
 * Implements hook_theme_registry_alter()
 * Loads templates from the tpl folder of this module into theme registry
 */
 function MODULENAME_theme_registry_alter(&$registry){
   $path = drupal_get_path('module', 'MODULENAME').'/tpl';
   $current_theme = variable_get('theme_default','none');
   _theme_process_registry($registry, 'phptemplate', 'theme_engine', $current_theme, $path);
 }