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 theme.inc 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. }

URL: http://cheekymonkeymedia.ca/blog/brian-top-chimp/how-have-drupal-7-node-type-page-tpls

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.