Node Type Page TPLs

/ Published in: PHP
Save to your folder(s)

Add this snippet to template.php

Copy this code and paste it in your HTML
  1. function themeName_preprocess_page(&$variables, $hook) {
  2. // When this goes through the some where it changes _ to - so the tpl name is actually page--type-typename.tpl
  3. if (isset($variables['node'])) {
  4. $variables['theme_hook_suggestions'][] = 'page__type__'. str_replace('_', '--', $variables['node']->type);
  5. }
  6. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.