Skip to content

Instantly share code, notes, and snippets.

@joshuapowell
Created January 26, 2012 02:14
Show Gist options
  • Save joshuapowell/1680508 to your computer and use it in GitHub Desktop.
Save joshuapowell/1680508 to your computer and use it in GitHub Desktop.
Drupal: Allow for Node Type specific html.tpl.php files (e.g., html--story.tpl.php, html--page.tpl.php, html--webform.tpl.php)
<?php
/**
* Implementation of hook_preprocess_html().
*/
function MYTHEME_preprocess_html(&$variables, $hook) {
if ($node = menu_get_object()) {
if (isset($node->type)) {
$variables['theme_hook_suggestions'][] = 'html__' . str_replace('_', '--', $node->type);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment