Posted By

aleprieto on 08/26/08


Tagged

template node drupal phptemplate


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

basicmagic


Separate theme for a specific node


 / Published in: PHP
 

URL: http://drupal.org/node/136647

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  

Comments

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: http://drupal.org/node/104316. Sorry if I misunderstood. Thanks for posting Drupal stuff here!

You need to login to post a comment.