more power from node.tpl

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. function wim_preprocess_node(&$variables) {
  2. $function = 'wim_preprocess_node'.'_'. $variables['node']->type;
  3. if (function_exists($function)) {
  4. $function(&$variables, $hook);
  5. }
  6. }
  8. Each nodetype gets its own preprocess_node function like this, so the code can be a bit cleaner.


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.