How can you add a field value to css? I know this is possible in views -> style settings of a field, but what if you can't customize the fields? 

I would like to add css to the mini calendar from the calendar-module depending on the value of a field called 'field_location'.

So class="fri mini future has-events " becomes class="fri mini future has-events field_location"

I copied the calendar-mini.tpl.php and on line 49 I changed

&lt; td id=" &lt; ?php print $cell['id']; ? &gt;" class="&lt; ?php print $cell['class']; ? &gt;"&gt;


into:

&lt; td id=" &lt; ?php print $cell['id']; ? &gt;" class="&lt; ?php print $cell['class'] ' ' . $node-&gt;field_location['und'][0]['value']; ? &gt;"&gt;


If I use $node = node_load(736); it works, but it adds the 'field_location' of that node to all classes. 
I need to place the right 'field_location' in the right class.
Copying out the relevant portion of the template:

&lt;tbody&gt;
  &lt;?php foreach ((array) $rows as $row): ?&gt;
    &lt;tr&gt;
      &lt;?php foreach ($row as $cell): ?&gt;
        &lt;td id="&lt;?php print $cell['id']; ?&gt;" class="&lt;?php print $cell['class']; ?&gt;"&gt;
          &lt;?php print $cell['data']; ?&gt;
        &lt;/td&gt;
      &lt;?php endforeach; ?&gt;
    &lt;/tr&gt;
  &lt;?php endforeach; ?&gt;
&lt;/tbody&gt;


If you want the &lt;td&gt; wrapping your cell to have an additional class based upon what is inside that cell, you will need to do something like this:

&lt;tbody&gt;
  &lt;?php foreach ((array) $rows as $row): ?&gt;
    &lt;tr&gt;
      &lt;?php foreach ($row as $cell): ?&gt;
        &lt;?php
          $new_class= // grab information out of $cell['data']
        ?&gt;
        &lt;td id="&lt;?php print $cell['id']; ?&gt;" class="&lt;?php print $cell['class'] . ' ' .  $new_class; ?&gt;"&gt;
          &lt;?php print $cell['data']; ?&gt;
        &lt;/td&gt;
      &lt;?php endforeach; ?&gt;
    &lt;/tr&gt;
  &lt;?php endforeach; ?&gt;
&lt;/tbody&gt;


If it's not easy to do, $cell['data'] is probably HTML since it is just being printed, you do have the entire $view object to work with, and there, you can grab stuff out of $view-&gt;result and correlate that to these cells.