Created
January 26, 2012 02:16
-
-
Save joshuapowell/1680516 to your computer and use it in GitHub Desktop.
Drupal: Allow for Node Type specific page.tpl.php files (e.g., page--node--story.tpl.php, page--node--page.tpl.php, page--node--webform.tpl.php)
This file contains hidden or 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 | |
| /** | |
| * Implementation of hook_preprocess_page(). | |
| */ | |
| function MYTHEME_preprocess_page(&$variables, $hook) { | |
| // Allow for page templates, based on node type | |
| if (isset($variables['node'])) { | |
| $variables['theme_hook_suggestions'][] = 'page__node__' . str_replace('_', '--', $variables['node']->type); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment