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. }
  7.  
  8. Each nodetype gets its own preprocess_node function like this, so the code can be a bit cleaner.

URL: http://blogthingee.com/blog/too-much-more-power-your-nodetpl

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.