I had a situation where I wanted individual nodes within a view to appear different from one another. (e.g. add additional spacing at specific places in a grid view, color code the grid for easy scanning, etc) To accomplish this, I tagged each node with a series of taxonomy terms associated with various traits.
Then I created a view with the name 'related_ports'. Style: grid. Row style: fields. I included Taxonomy: All terms as one of the fields and set the terms to display with a simple comma separator. (Note: don't 'exclude this field from display' even though you don't want it to appear. Apparently if it's excluded from display, the taxonomy terms are not available in the view fields template.)
Then, I created a template file named: views-view-fields--related-ports.tpl.php based on the default view template file views-view-fields.tpl.php
At the top of this file, I included the following code:
<?php
if (!empty($fields['tid']->content)) {
$terms = explode(', ', $fields['tid']->content);
$class = 'views-port-node';
foreach ($terms as $term) {
$class .= ' '. str_replace(' ', '-', ereg_replace("[^a-z0-9] ", "", trim(strtolower($term))));
}
}
?>
This converts all the terms into CSS classes based on the term names. Finally, I wrapped the view results in individual divs with the classes associated with the node result. This allowed me to use CSS to theme each node individually within a view based on the taxonomy terms the node was tagged with.