Creating Preprocess function to add extra classes dependent on field value I have a content type called "article" and I have a field called "text color" and I want to add this text color field's value as a class to either the body or content container and change the text color of the content. 


Which preprocess function should i go about using?
Is it possible to just do an inline style using the text color field's value so i don't have to also edit my css file too?
Or is there another elegant way of doing this without using a preprocess function?
You can add the class to the body from the node field value in hook_preprocess_html

Something like:

/**
 * Implements hook_preprocess_html
 */
function THEME_preprocess_html(&amp;$vars){
  // Check if on an article node page
  if($node = menu_get_object('node') &amp;&amp; $node-&gt;type == 'article'){
    // Get field values
    if($text_color = field_get_items('node', $node, 'field_text_color')){
      // Add first text_color value to body class
      $vars['classes_array'][] = drupal_html_class(reset($text_color));
    }
  }

}