tseven

Adding custom template hints in Drupal 6

May 12th, 2011
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. /* this function will add a template entry for the node using it's id.
  2.     i.e. each node -could- have it's own template file.. following the
  3.     schema of: node-112.tpl.php where 112 is the node id. */
  4.  
  5. function THEMENAME_preprocess_node(&$vars){  
  6.     $vars['template_files'][] = 'node-'. $vars['node']->nid;
  7. }
  8. function THEMENAME_preprocess_page(&$vars){  
  9.     $vars['template_files'][] = 'page-'. $vars['node']->type;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment