Skip to content

Instantly share code, notes, and snippets.

@eristoddle
Created October 16, 2012 18:34
Show Gist options
  • Save eristoddle/3901121 to your computer and use it in GitHub Desktop.
Save eristoddle/3901121 to your computer and use it in GitHub Desktop.
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment