Add class to views row using a template I'm using Views 3 with Drupal 7. I'm trying to dynamically add a class to the "views-row" line of a view based on the node type. I have a view with a relationship which is duplicating items when a relationship exists. I thought by adding a class for the node type into the views-row line I could hide the field in the row. I'm not sure whether I should be overriding views-view-unformatted.tpl.php or views-view-fields.tpl.php, to add the class and how I can extract the node type from the data to add it into the the classes for that line.

I'd be grateful for any guidance.

Ben
Views itself will tell you which file to use as a template.  Go to the config page for the relevant view and choose Theme: Information under Other.  This will print out a list of potential templates; the template shown in bold is the one that is in use.

To get the node type, you can use the dpm() function of the devel module.  For example, if you have devel enabled, you can simply insert dpm($row) in the template file, load a page containing the view in your browser, and then dig through the output.