change theme on node type

WE HAVE MOVED!

Please visit our new Drupal Website at https://www.xenyo.com我們的新網頁設計公司網頁.

function modulename_menu_alter(&$items) {
  $items['node/%node/edit']['theme callback'] = 'jungle_edit_node_theme';
  $items['node/%node/edit']['theme arguments'] = array(1);
}
/**
 * return custom theme for article
 */
function modulename_edit_node_theme($node) {
  if ($node->type == 'article') {
    return 'themename';
  }
  else {
    modulename_default_node_theme();
  }
}
 
/**
 * default theme  
 */
function modulename_default_node_theme() {
  return 'seven';
}
Help Share this Article