Skip to content

Instantly share code, notes, and snippets.

@ivandoric
Created July 19, 2014 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivandoric/3a77c31e6f868fe4db6f to your computer and use it in GitHub Desktop.
Save ivandoric/3a77c31e6f868fe4db6f to your computer and use it in GitHub Desktop.
drupal: template suggestions depending on content type name
<?php
function themeName_preprocess_page(&$vars, $hook) {
if (isset($vars['node'])) {
// If the node type is "blog_madness" the template suggestion will be "page--blog-madness.tpl.php".
$vars['theme_hook_suggestions'][] = 'page__'. $vars['node']->type;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment