Views, add field value as class to list element I have a content field called Featured which is an list integer checkbox.

When using Views to display a list of this content, I would like to add a css class to the item wrapper when that value is 1 like so:

&lt;li class="views-row views-row-1 views-row-odd views-row-first featured"&gt;


I suspect editing the views row template would be one option, although I do not know how to achieve this, and since this is the only change I need to make, is there an easier way?
The question is a bit old, but i was looking for the same.
The answer is for drupal 7 / views 3.5, and works fine on Drupal Views 8 || 9 as well..
You can use some field replacement patterns when specifying the classname for the row (in the view edit : Format / Settings / Row Class )
To do so, on the same settings page you may have to check the box 'force using fields'
You then have to make sure the field you want to use is added to the fields section of the view edit
To know what pattern you can use, click on the field in the fields section and go to 'rewrite results' / 'rewrite the output of this field', there is a 'replacement patterns' block that will show you the available patterns.
hope that help, I'm still stuck though by the fact that the string you will get is not class friendly and may contain spaces.