Posted By

resting on 11/26/10


Tagged

template node page type drupal


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Onfire60


Drupal page template on nodetype


 / Published in: PHP
 

Only this portion needed

// Add page template suggestions based on node type, if we aren't editing the node.
    if ($vars['node'] && arg(2) != 'edit') {
      $vars['template_files'][] = 'page-nodetype-'. $vars['node']->type;
    }
  1. /**
  2.  * Override or insert PHPTemplate variables into the templates.
  3.  */
  4. function _phptemplate_variables($hook, $vars) {
  5. if ($hook == 'page') {
  6. // Add page template suggestions based on node type, if we aren't editing the node.
  7. if ($vars['node'] && arg(2) != 'edit') {
  8. $vars['template_files'][] = 'page-nodetype-'. $vars['node']->type;
  9. }
  10.  
  11. if ($secondary = menu_secondary_local_tasks()) {
  12. $output = '<span class="clear"></span>';
  13. $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
  14. $vars['tabs2'] = $output;
  15. }
  16.  
  17. // Hook into color.module
  18. if (module_exists('color')) {
  19. _color_page_alter($vars);
  20. }
  21. return $vars;
  22. }
  23. return array();
  24. }

Report this snippet  

You need to login to post a comment.