Posted By

createinside on 04/27/10


Tagged

content drupal specific tempalte


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Onfire60


Content-type (node) specific page templates in Drupal


 / Published in: PHP
 

  1. /* Makes node (or content-type) specific page templates. Add this to template.php. Replace templatename with your own template name */
  2. function templatename_preprocess_page(&$vars) {
  3.  
  4. if (arg(0) == 'node' && is_numeric(arg(1))) {
  5. $node = node_load(arg(1));
  6. $vars['template_files'][] = 'page-node-' . $node->type;
  7. }
  8. }

Report this snippet  

You need to login to post a comment.