Hello...

I just thought I'd post this as I've already found myself this change for two sites. Basically I had the need to render some special CSS for nodes with a specific taxonomy term assigned.

So I'm just overriding phptemplate_preprocess_node() and adding:

  if (isset($vars['taxonomy'])) {
    foreach($vars['taxonomy'] as $term_info) {
      $node_classes[] = 'taxonomy-'.zen_id_safe($term_info['title']);
    }  
  }

After the portion where node-type classes are set. I think this really could be useful for many situations where you want a node teaser to change in some way based on an assigned term.

Just a thought.. and thanks to everyone for work on Zen, it's excellent.. :)

Comments

Moonshine’s picture

Actually I ended up needing to expand on this code a bit, so I'll post my preprocess hooks here.

Basically it sets taxonomy based class additions to the "body" for a node "page", and taxonomy based classes to individual divs for node teasers. That way they can be targeted differently via CSS. I can certainly roll it into a more direct patch for Zen if there is interest in adding it... it's quite simple.

_preprocess_page:


function moonshine_preprocess_page(&$vars) {
  
  // Let's call the Zen hook first
  phptemplate_preprocess_page(&$vars);  
  
  // Let's add any taxonomy terms for node pages
  if (isset($vars['node']->taxonomy)) {
    $body_classes = array();
    foreach($vars['node']->taxonomy as $term_info) {
      $body_classes[] = 'taxonomy-'.zen_id_safe($term_info->name);
    }
    $vars['body_classes'] .= " ".implode(' ', $body_classes); // Concatenate with spaces
  }
}

_preprocess_node:


function moonshine_preprocess_node(&$vars) {

  // Let's call the Zen hook first
  phptemplate_preprocess_node(&$vars);
  
  // Let's add any taxonomy terms for node teasers
  if ($vars['teaser'] && isset($vars['taxonomy'])) {
    $node_classes = array();
    foreach($vars['taxonomy'] as $term_info) {
      $node_classes[] = 'taxonomy-'.zen_id_safe($term_info['title']);
    }
    $vars['node_classes'] .= " ". implode(' ', $node_classes); // Concatenate with spaces
  }
}

johnalbin’s picture

Wouldn't using the taxonomy ID be safer than using the name? That way you could, for example, fix a typo in the name without changing your CSS.

Plus, what if you are using Chinese characters for your taxonomy name? zen_id_safe would convert it to an empty string.

Moonshine’s picture

Good points. I actually started with the id, but ended up changing to tag names as it just allowed for a few things that I liked:

  • Simple cross-site theme use. ie. Term of "Mobile" didn't have to have the same ID # on all sites for the theme to be useful.
  • Key on "same" terms accross vocabularies easily. (although this could also be a problem for for other senarios :/ )
  • CSS readabilty without having a comment for every entry
  • Didn't slow me down firebuggn' the id for every term I was keying on (lazy, but true.. :) )

But your certainly correct, especially re: other languages.

Personally I think having both ID and name (if not blank) would be the best of both worlds though. I'll add that to the code, as I can see where ids would definitely come in handy for situations were #2 above is not the desired action.

Updated idea:

_preprocess_page:


function moonshine_preprocess_page(&$vars) {
  
  // Let's call the Zen hook first
  phptemplate_preprocess_page(&$vars);  
  
  // Let's add any taxonomy terms for node pages
  if (isset($vars['node']->taxonomy)) {
    $body_classes = array();
    foreach ($vars['node']->taxonomy as $taxonomy_id => $term_info) {
      $body_classes[] = 'taxonomy-id-'. $taxonomy_id;
      $taxonomy_name = zen_id_safe($term_info->name);
      if ($taxonomy_name) {
        $body_classes[] = 'taxonomy-name-'. $taxonomy_name;
      }
    }
    $vars['body_classes'] .= " ". implode(' ', $body_classes); // Concatenate with spaces
  }
}

_preprocess_node:


function moonshine_preprocess_node(&$vars) {

  // Let's call the Zen hook first
  phptemplate_preprocess_node(&$vars);
  
  // Let's add any taxonomy terms for node teasers
  if ($vars['teaser'] && isset($vars['taxonomy'])) {
    $node_classes = array();
    foreach ($vars['taxonomy'] as $taxonomy_id_string => $term_info) {
      $taxonomy_id = array_pop(explode('_', $taxonomy_id_string));
      $node_classes[] = 'taxonomy-id-'. $taxonomy_id;
      $taxonomy_name = zen_id_safe($term_info['title']);
      if ($taxonomy_name) {
        $node_classes[] = 'taxonomy-name-'. $taxonomy_name;
      }
    }
    $vars['node_classes'] .= " ". implode(' ', $node_classes); // Concatenate with spaces
  }
}

naught101’s picture

This is a great idea. It would also make sense to have the node-id and the node-name in the body class as well.

naught101’s picture

Status: Active » Needs review
artis’s picture

DRUPAL 5.x Comment:
This works in Drupal 5 Zen Theme also!

I added part of this code in my template.php file under the function _phptemplate_variables line 173, right before the break; in the case 'node': section

if ($vars['taxonomy']) {
        foreach ($vars['taxonomy'] as $taxonomy_id_string => $term_info) {
          $taxonomy_id = array_pop(explode('_', $taxonomy_id_string));
            $node_classes[] = 'taxonomy-id-'. $taxonomy_id;
            $taxonomy_name = zen_id_safe($term_info['title']);
              if ($taxonomy_name) {
                $node_classes[] = 'taxonomy-name-'. $taxonomy_name;
              }
        }
        $vars['node_classes'] .= " ". implode(' ', $node_classes); // Concatenate with spaces
      }

This works beautifully because you get the name and id classes in the node div. I don't really see a need to have them in the body element so I skipped that part.

wilfn’s picture

Component: Code » PHP Code

Using Zen 6.x-1.0: this only worked for me when I substituted "zen_preprocess_node" in place of "phptemplate_preprocess_node" and "$classes" in place of "$node_classes" (in Moonshine's updated version above). Also taking out the test for 'teaser' content and the _preprocessor_page (I only need the node classes), the code snippet now looks like this:

function THEMENAME_preprocess_node(&$vars) {
  // Let's call the Zen hook first
  zen_preprocess_node(&$vars);
 
  // Let's add any taxonomy terms for node teasers
  if (isset($vars['taxonomy'])) {
    $classes = array();
    foreach ($vars['taxonomy'] as $taxonomy_id_string => $term_info) {
      $taxonomy_id = array_pop(explode('_', $taxonomy_id_string));
      $classes[] = 'taxonomy-id-'. $taxonomy_id;
      $taxonomy_name = zen_id_safe($term_info['title']);
      if ($taxonomy_name) {
        $classes[] = 'taxonomy-name-'. $taxonomy_name;
      }
    }
    $vars['classes'] .= " ". implode(' ', $classes); // Concatenate with spaces
  }

Hope this is of help to someone. Comments appreciated also if I've done something wrong (I'm a bit of a newbie).

Oh, and I heartily agree with Moonshine's original comment - thanks to all responsible for Zen!

eatanicecream’s picture

None of these seem to work for me, all I get is <body class="not-front logged-in page-node node-type-book two-sidebars">

I'm working with a site that wasn't originally built by me, so I've no idea what theme it was based on (I'm presuming it was ZEN). I don't know much PHP either...

I'd like to get body_classes to display the taxonomy terms for each node.

Here's my template.php file:


<?php
// $Id: template.php,v 1.1.4.7.2.1 2009/05/05 18:01:38 couzinhub Exp $
    
// Auto-rebuild the theme registry during theme development.
if (theme_get_setting('basic_rebuild_registry')) {
  drupal_rebuild_theme_registry();
}

//
//	from ZEN // Override or insert PHPTemplate variables into the page templates.
//	
//	 This function creates the body classes that are relative to each page
//	
//	@param $vars
//	  A sequential array of variables to pass to the theme template.
//	@param $hook
//	  The name of the theme function being called ("page" in this case.)
//

function basic_preprocess_page(&$vars, $hook) {
  global $theme;

  // Don't display empty help from node_help().
  if ($vars['help'] == "<div class=\"help\"><p></p>\n</div>") {
    $vars['help'] = '';
  }

  // Classes for body element. Allows advanced theming based on context
  // (home page, node of certain type, etc.)
  $body_classes = array($vars['body_classes']);
  if (user_access('administer blocks')) {
	  $body_classes[] = 'admin';
	}
  if (!$vars['is_front']) {
    // Add unique classes for each page and website section
    $path = drupal_get_path_alias($_GET['q']);
    list($section, ) = explode('/', $path, 2);
    $body_classes[] = basic_id_safe('page-'. $path);
    $body_classes[] = basic_id_safe('section-'. $section);

    if (arg(0) == 'node') {
      if (arg(1) == 'add') {
        if ($section == 'node') {
          array_pop($body_classes); // Remove 'section-node'
        }
        $body_classes[] = 'section-node-add'; // Add 'section-node-add'
      }
      elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
        if ($section == 'node') {
          array_pop($body_classes); // Remove 'section-node'
        }
        $body_classes[] = 'section-node-'. arg(2); // Add 'section-node-edit' or 'section-node-delete'
      }
    }
  }
  //// Check what the user's browser is and add it as a body class
  //// DEACTIVATED - Only works if page cache is deactivated
  //$user_agent = $_SERVER['HTTP_USER_AGENT'];
  //if($user_agent) {
  //  if (strpos($user_agent, 'MSIE')) {
  //    $body_classes[] = 'browser-ie';
  //  } else if (strpos($user_agent, 'MSIE 6.0')) {
  //    $body_classes[] = 'browser-ie6';
  //  } else if (strpos($user_agent, 'MSIE 7.0')) {
  //    $body_classes[] = 'browser-ie7';
  //  } else if (strpos($user_agent, 'MSIE 8.0')) {
  //    $body_classes[] = 'browser-ie8'; 
  //  } else if (strpos($user_agent, 'Firefox/2')) {
  //    $body_classes[] = 'browser-firefox2';
  //  } else if (strpos($user_agent, 'Firefox/3')) {
  //    $body_classes[] = 'browser-firefox3';
  //  }else if (strpos($user_agent, 'Safari')) {
  //    $body_classes[] = 'browser-safari';
  //  } else if (strpos($user_agent, 'Opera')) {
  //    $body_classes[] = 'browser-opera';
  //  }
  //}
  
  // Add template suggestions based on content type
  // You can use a different page template depending on the
  // content type or the node ID
  // For example, if you wish to have a different page template
  // for the story content type, just create a page template called
  // page-type-story.tpl.php
  // For a specific node, use the node ID in the name of the page template
  // like this : page-node-22.tpl.php (if the node ID is 22)
  
  if ($vars['node']->type != "") {
      $vars['template_files'][] = "page-type-" . $vars['node']->type;
    }
  if ($vars['node']->nid != "") {
      $vars['template_files'][] = "page-node-" . $vars['node']->nid;
    }
  $vars['body_classes'] = implode(' ', $body_classes); // Concatenate with spaces
}



//
//	from ZEN // Override or insert PHPTemplate variables into the node templates.
//	
//	 This function creates the NODES classes, like 'node-unpublished' for nodes
//	 that are not published, or 'node-mine' for node posted by the connected user...
//	
//	@param $vars
//	  A sequential array of variables to pass to the theme template.
//	@param $hook
//	  The name of the theme function being called ("node" in this case.)
//

function basic_preprocess_node(&$vars, $hook) {
  global $user;

  // Special classes for nodes
  $node_classes = array();
  if ($vars['sticky']) {
    $node_classes[] = 'sticky';
  }
  if (!$vars['node']->status) {
    $node_classes[] = 'node-unpublished';
    $vars['unpublished'] = TRUE;
  }
  else {
    $vars['unpublished'] = FALSE;
  }
  if ($vars['node']->uid && $vars['node']->uid == $user->uid) {
    // Node is authored by current user
    $node_classes[] = 'node-mine';
  }
  if ($vars['teaser']) {
    // Node is displayed as teaser
    $node_classes[] = 'node-teaser';
  }
  // Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc.
  $node_classes[] = 'node-type-'. $vars['node']->type;
  $vars['node_classes'] = implode(' ', $node_classes); // Concatenate with spaces
}


//
// from ZEN // Override or insert PHPTemplate variables into the block templates.
//
//	This function create the EDIT LINKS for blocks and menus blocks.
//	When overing a block (except in IE6), some links appear to edit
//	or configure the block. You can then edit the block, and once you are
//	done, brought back to the first page.
//
// @param $vars
//   A sequential array of variables to pass to the theme template.
// @param $hook
//   The name of the theme function being called ("block" in this case.)
// 

function basic_preprocess_block(&$vars, $hook) {
  $block = $vars['block'];

  if (theme_get_setting('basic_block_editing') && user_access('administer blocks')) {
    // Display 'edit block' for custom blocks
    if ($block->module == 'block') {
      $edit_links[] = l( t('edit block'), 'admin/build/block/configure/'. $block->module .'/'. $block->delta, array('title' => t('edit the content of this block'), 'class' => 'block-edit'), drupal_get_destination(), NULL, FALSE, TRUE);
    }
    // Display 'configure' for other blocks
    else {
      $edit_links[] = l(t('configure'), 'admin/build/block/configure/'. $block->module .'/'. $block->delta, array('title' => t('configure this block'), 'class' => 'block-config'), drupal_get_destination(), NULL, FALSE, TRUE);
    }

    // Display 'edit menu' for menu blocks
    if (($block->module == 'menu' || ($block->module == 'user' && $block->delta == 1)) && user_access('administer menu')) {
      $edit_links[] = l(t('edit menu'), 'admin/build/menu', array('title' => t('edit the menu that defines this block'), 'class' => 'block-edit-menu'), drupal_get_destination(), NULL, FALSE, TRUE);
    }
    $vars['edit_links_array'] = $edit_links;
    $vars['edit_links'] = '<div class="edit">'. implode(' ', $edit_links) .'</div>';
  }
}


//
//  Create some custom classes for comments
//

function comment_classes($comment) {
  $node = node_load($comment->nid);
  global $user;
 
  $output .= ($comment->new) ? ' comment-new' : ''; 
  $output .=  ' '. $status .' '; 
  if ($node->name == $comment->name) {	
    $output .= 'node-author';
  }
  if ($user->name == $comment->name) {	
    $output .=  ' mine';
  }
  return $output;
}


// 	
// 	Customize the PRIMARY and SECONDARY LINKS, to allow the admin tabs to work on all browsers
// 	An implementation of theme_menu_item_link()
// 	
// 	@param $link
// 	  array The menu item to render.
// 	@return
// 	  string The rendered menu item.
// 	

function basic_menu_item_link($link) {
  if (empty($link['options'])) {
    $link['options'] = array();
  }

  // If an item is a LOCAL TASK, render it as a tab
  if ($link['type'] & MENU_IS_LOCAL_TASK) {
    $link['title'] = '<span class="tab">'. check_plain($link['title']) .'</span>';
    $link['options']['html'] = TRUE;
  }

  if (empty($link['type'])) {
    $true = TRUE;
  }

  return l($link['title'], $link['href'], $link['options']);
}

/**
 * Duplicate of theme_menu_local_tasks() but adds clear-block to tabs.
 */
function basic_menu_local_tasks() {
  $output = '';

  if ($primary = menu_primary_local_tasks()) {
    $output .= "<ul class=\"tabs primary clear-block\">\n". $primary ."</ul>\n";
  }
  if ($secondary = menu_secondary_local_tasks()) {
    $output .= "<ul class=\"tabs secondary clear-block\">\n". $secondary ."</ul>\n";
  }

  return $output;
}

//	
//	Add custom classes to menu item
//	
	
function basic_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
  $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
  if (!empty($extra_class)) {
    $class .= ' '. $extra_class;
  }
  if ($in_active_trail) {
    $class .= ' active-trail';
  }
#New line added to get unique classes for each menu item
  $css_class = basic_id_safe(str_replace(' ', '_', strip_tags($link)));
  return '<li class="'. $class . ' ' . $css_class . '">' . $link . $menu ."</li>\n";
}


//	
//	Converts a string to a suitable html ID attribute.
//	
//	 http://www.w3.org/TR/html4/struct/global.html#h-7.5.2 specifies what makes a
//	 valid ID attribute in HTML. This function:
//	
//	- Ensure an ID starts with an alpha character by optionally adding an 'n'.
//	- Replaces any character except A-Z, numbers, and underscores with dashes.
//	- Converts entire string to lowercase.
//	
//	@param $string
//	  The string
//	@return
//	  The converted string
//	


function basic_id_safe($string) {
  // Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.
  $string = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string));
  // If the first character is not a-z, add 'n' in front.
  if (!ctype_lower($string{0})) { // Don't use ctype_alpha since its locale aware.
    $string = 'id'. $string;
  }
  return $string;
}


//
//  Return a themed breadcrumb trail.
//	Alow you to customize the breadcrumb markup
//

function basic_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    return '<div class="breadcrumb">'. implode(' » ', $breadcrumb) .'</div>';
  }
}


//
// customise the submitted by links
//

function wdm_node_submitted($node) {
  return t('Posted by !username on @date', array(
    '!username' => theme('username', $node),
    '@date' => format_date($node->created, 'custom', 'd M Y')
  ));
}

function wdm_comment_submitted($comment) {
  return t('Posted by !username on @date at about @time.', array(
    '!username' => theme('username', $comment),
    '@date' => format_date($comment->timestamp, 'custom', 'd M Y'),
    '@time' => format_date($comment->timestamp, 'custom', 'H:i')
  ));
}

// make form elements uncollapsed - because of conflict with lightview JS

function wdm_page_node_form($form) {
  $output = '';
  $form['menu_settings']['#collapsed'] = 1; /* $form['menu_settings']['#collapsed'] = 1; Not collapsed $form['menu_settings']['#collapsed'] = 0; Is collapsed */
  $output .= drupal_render($form);
  return $output;
} 

/**
 * Primary theme function (modified from upload.module)
 */
function shiny_upload_upload_attachments($files) {
  $header = array(t('Attachment'), t('Size'));
  $file_output = array();
  foreach ($files as $file) {
    $file = (object)$file;
    if ($file->list && empty($file->remove)) {
			$file_url = file_create_url($file->filepath);
      $text = shiny_upload_file_icon($file) . $file->description ? $file->description : $file->filename;
      $file_link = '<div class="file-link">'.  l(shiny_upload_file_icon($file) . $text, $file_url, array('html'=>'true')) . '</div>';
      $file_metadata = '<div class="file-metadata"><span class="file-name">' . $file->filename . ' <span class="file-size" >' . format_size($file->filesize) . 
      '</span></div>';
      
      $file_output[] = '<div class="file-file">' . $file_link . $file_metadata . '</div>';
    }
  }
  
  if (count($file_output)) {
    return '<div class="file-uploads"><h3>Downloads</h3>' .  implode("\n", $file_output) . '</div>';
  }
}




// The following has been modified from the filefield module
// $Id: filefield.module,v 1.138 2008/08/01 04:58:59 dopry Exp $

/**
 * Return an image with an appropriate icon for the given file.
 * Remember to pass a file object and not an array.
 */
function shiny_upload_file_icon($file) {
  if (is_object($file)) {
    $file = (array) $file;
  }
  $mime = check_plain($file['filemime']);

  $dashed_mime = strtr($mime, array('/' => '-'));

  if ($icon_url = _shiny_upload_icon_url($file)) {
    $icon = '<img class="field-icon-'. $dashed_mime .'"  alt="'. $mime .' icon" src="'. $icon_url .'" />';
  }
  return '<span class="filefield-icon field-icon-'. $dashed_mime .'">'. $icon .'</span>';
}

function _shiny_upload_icon_url($file) {
  global $base_url;
  $theme = 'protocons';  //default to the default icons

  if ($iconpath = _shiny_upload_icon_path($file, $theme)) {
    return $base_url .'/'. $iconpath;
  }
  return FALSE;
}

function _shiny_upload_icon_path($file, $theme = 'protocons') {
  // If there's an icon matching the exact mimetype, go for it.
  $dashed_mime = strtr($file['filemime'], array('/' => '-'));
  if ($iconpath = _shiny_upload_create_icon_path($dashed_mime, $theme)) {
    return $iconpath;
  }
  // For a couple of mimetypes, we can "manually" tell a generic icon.
  if ($generic_name = _shiny_upload_generic_icon_map($file)) {
    if ($iconpath = _shiny_upload_create_icon_path($generic_name, $theme)) {
      return $iconpath;
    }
  }
  // Use generic icons for each category that provides such icons.
  foreach (array('audio', 'image', 'text', 'video') as $category) {
    if (strpos($file['filemime'], $category .'/') === 0) {
      if ($iconpath = _shiny_upload_create_icon_path($category .'-x-generic', $theme)) {
        return $iconpath;
      }
    }
  }
  // Try application-octet-stream as last fallback.
  if ($iconpath = _shiny_upload_create_icon_path('application-octet-stream', $theme)) {
    return $iconpath;
  }
  // Sorry, no icon can be found...
  return FALSE;
}

function _shiny_upload_create_icon_path($iconname, $theme = 'protocons') {
  $iconpath = path_to_theme()
    .'/file-icons/'. $theme .'/16x16/mimetypes/'. $iconname .'.png';
    
  if (file_exists($iconpath)) {
    return $iconpath;
  }
  return FALSE;
}

function _shiny_upload_generic_icon_map($file) {
  switch ($file['filemime']) {
    // Word document types.
    case 'application/msword':
    case 'application/vnd.ms-word.document.macroEnabled.12':
    case 'application/vnd.oasis.opendocument.text':
    case 'application/vnd.oasis.opendocument.text-template':
    case 'application/vnd.oasis.opendocument.text-master':
    case 'application/vnd.oasis.opendocument.text-web':
    case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
    case 'application/vnd.stardivision.writer':
    case 'application/vnd.sun.xml.writer':
    case 'application/vnd.sun.xml.writer.template':
    case 'application/vnd.sun.xml.writer.global':
    case 'application/vnd.wordperfect':
    case 'application/x-abiword':
    case 'application/x-applix-word':
    case 'application/x-kword':
    case 'application/x-kword-crypt':
      return 'x-office-document';

    // Spreadsheet document types.
    case 'application/vnd.ms-excel':
    case 'application/vnd.ms-excel.sheet.macroEnabled.12':
    case 'application/vnd.oasis.opendocument.spreadsheet':
    case 'application/vnd.oasis.opendocument.spreadsheet-template':
    case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
    case 'application/vnd.stardivision.calc':
    case 'application/vnd.sun.xml.calc':
    case 'application/vnd.sun.xml.calc.template':
    case 'application/vnd.lotus-1-2-3':
    case 'application/x-applix-spreadsheet':
    case 'application/x-gnumeric':
    case 'application/x-kspread':
    case 'application/x-kspread-crypt':
      return 'x-office-spreadsheet';

    // Presentation document types.
    case 'application/vnd.ms-powerpoint':
    case 'application/vnd.ms-powerpoint.presentation.macroEnabled.12':
    case 'application/vnd.oasis.opendocument.presentation':
    case 'application/vnd.oasis.opendocument.presentation-template':
    case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
    case 'application/vnd.stardivision.impress':
    case 'application/vnd.sun.xml.impress':
    case 'application/vnd.sun.xml.impress.template':
    case 'application/x-kpresenter':
      return 'x-office-presentation';

    // Compressed archive types.
    case 'application/zip':
    case 'application/x-zip':
    case 'application/stuffit':
    case 'application/x-stuffit':
    case 'application/x-7z-compressed':
    case 'application/x-ace':
    case 'application/x-arj':
    case 'application/x-bzip':
    case 'application/x-bzip-compressed-tar':
    case 'application/x-compress':
    case 'application/x-compressed-tar':
    case 'application/x-cpio-compressed':
    case 'application/x-deb':
    case 'application/x-gzip':
    case 'application/x-java-archive':
    case 'application/x-lha':
    case 'application/x-lhz':
    case 'application/x-lzop':
    case 'application/x-rar':
    case 'application/x-rpm':
    case 'application/x-tzo':
    case 'application/x-tar':
    case 'application/x-tarz':
    case 'application/x-tgz':
      return 'package-x-generic';

    // Script file types.
    case 'application/ecmascript':
    case 'application/javascript':
    case 'application/mathematica':
    case 'application/vnd.mozilla.xul+xml':
    case 'application/x-asp':
    case 'application/x-awk':
    case 'application/x-cgi':
    case 'application/x-csh':
    case 'application/x-m4':
    case 'application/x-perl':
    case 'application/x-php':
    case 'application/x-ruby':
    case 'application/x-shellscript':
    case 'text/vnd.wap.wmlscript':
    case 'text/x-emacs-lisp':
    case 'text/x-haskell':
    case 'text/x-literate-haskell':
    case 'text/x-lua':
    case 'text/x-makefile':
    case 'text/x-matlab':
    case 'text/x-python':
    case 'text/x-sql':
    case 'text/x-tcl':
      return 'text-x-script';

    // HTML aliases.
    case 'application/xhtml+xml':
      return 'text-html';

    // Executable types.
    case 'application/x-macbinary':
    case 'application/x-ms-dos-executable':
    case 'application/x-pef-executable':
      return 'application-x-executable';

    default:
      return FALSE;
  }
}


$node = node_load($vars['node']->nid);
foreach (taxonomy_node_get_terms($node) as $term) {
$vars['node_terms'] = $vars['node_terms'] . 'b-tax-' . eregi_replace('[^a-z0-9]', '-', $term->name);
}


Many thanks!

naught101’s picture

Component: PHP Code » layout.css
Status: Needs review » Active

Should never have changed that, since there is no patch. Sorry.

echoz’s picture

Status: Active » Fixed

@naught101, you had changed that status 5 yrs ago! Since the last post was from 3yrs ago and not sure it was Zen, I'm marking this as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.