Created
July 19, 2014 15:47
-
-
Save ivandoric/3a77c31e6f868fe4db6f to your computer and use it in GitHub Desktop.
drupal: template suggestions depending on content type name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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