Use Views field output as a class? Tokens? I have a field in my view which displays the taxonomy vocabulary that each result/node is linked to. However, I need a way to get that taxonomy vocabulary result and use it as a class for the view row - not just the field.

Has anyone had any success with something like this before? Options I can think of might be Tokens, direct template theming, or Display Suite, but I don't know how I would go about fetching that vocabulary field output and using it as the row's class.

Any help would be received gratefully :)
If you're looking to use it as a class for the whole row rather than just for the field, use a views template.

The Advanced -> OTHER -> Theme: Information section of your view usually has good ideas on what to call files but it doesn't seem to include anything for the row.

If you're using row style: fields... try making a template file called views-view-fields--myviewname.tpl.php.

To dig into the variables available to that template file, the first thing you want to do is install the Devel module, turn it on, and put this in the template:

dpm($content);


or maybe

dpm($output);


dpm() prints the named variable on the screen when the file is run.