Conditional markup field display I have content type with a term reference field.  Let's call it 'Color'.  I want the content type to display markup depending on which term has been selected in the term reference field.  For example, if 'Color' is Red, then the markup field will display 'Red is the color of fire'.  If 'Color' is Purple, the markup field will display 'Purple is the color of royalty'.

Any ideas?

Thanks
You need to implement hook_preprocess_HOOK(&amp;$variables), and add processing there, like this:

&lt;?php

function MYTHEME_preprocess_node(&amp;$variables) {
    // Check if field tid (term id) is filled up
    if (isset($variables-&gt;field_term_color[LANGUAGE_NONE][0]['tid'])) {
        $color = $variables-&gt;field_term_color[LANGUAGE_NONE][0]['tid'];

        $text = '';
        // You need to look up tid of each color
      switch ($color) {
        case 123:
            $text = 'Red is the color of fire.'
            break;
      }

      // Assign value to markup (text) node field
      $variables-&gt;field_markup_field[LANGUAGE_NONE][0]['value'] = $text;
    }
}

?&gt;


You should place the right field names instead of the ones I use, of course.