Add Per-Type and Per-ViewMode Functions to Omega

By default, Omega doesn't create preprocess functions per content type.  This snippet does this.  You need to keep them in preprocss-node.inc, though.

/**
 * Implements hook_preprocess_node().
 */
function MYTHEME_alpha_preprocess_node(&$variables) {
  $node = $variables['node'];
  $view_mode = $variables['view_mode'];
  $type = $node->type;

  $subhooks = array(
    __FUNCTION__ . '_' . $type,
    __FUNCTION__ . '_' . $view_mode,
    __FUNCTION__ . '_' . $type . '_' . $view_mode,
  );

  foreach ($subhooks as $subhook) {
    if (function_exists($subhook)) {
      $subhook($variables);
    }
  }
}

Tags

drupal omega theming