Posted By

mktimes5 on 02/22/12


Tagged

drupal


Versions (?)

Node Type Page TPLs


 / Published in: PHP
 

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

Add this snippet to template.php

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

Report this snippet  

You need to login to post a comment.