Skip to content

Instantly share code, notes, and snippets.

@mohamedrez
Created October 24, 2015 10:19
Show Gist options
  • Save mohamedrez/b5d98dfb518b7cca9ca5 to your computer and use it in GitHub Desktop.
Save mohamedrez/b5d98dfb518b7cca9ca5 to your computer and use it in GitHub Desktop.
Drupal 7: tpl on module
/**
* Implements hook_theme().
*/
function mymodule_theme($existing, $type, $theme, $path) {
$theme = array();
$theme['node__blog_post'] = array(
'render element' => 'content',
'base hook' => 'node',
'template' => 'node--blog_post',
'path' => drupal_get_path('module', 'mymodule') . '/templates',
);
return $theme;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment