Posted By

aleprieto on 08/26/08


template node drupal phptemplate

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Separate theme for a specific node

 / Published in: PHP


If you want to use a specific node.tpl.php for a node, paste or merge this code into your template.php

  1. <?php
  2. function _phptemplate_variables($hook, $vars = array()) {
  3. switch ($hook) {
  4. case 'node':
  5. $vars['template_files'] = array('node-'. $vars['nid']);
  6. break;
  7. }
  8. return $vars;
  9. }
  10. ?>

Report this snippet  


RSS Icon Subscribe to comments
Posted By: shrop on August 26, 2008

This should be built in Drupal 5 and 6 already. Name your templates files page-node-1.tpl.php. See: Sorry if I misunderstood. Thanks for posting Drupal stuff here!

You need to login to post a comment.