Drupal 7 - Create content type specific page.tpl

function THEME_preprocess_page(&$variables, $hook) { // When this goes through the theme.inc some where it changes _ to - so the tpl name is actually page--type--typename.tpl if (isset($variables['node'])) { $variables['theme_hook_suggestions'][] = 'page__type__'. str_replace('_', '--', $variables['node']->type); } }
Input this snippet into your template.php file in the theme folder.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.