I have code which checks if field exists, but I try to change it to check if field has value (content) or not.
In views I have one field to show all content (Rewrite results). So all fields are loaded always. Thats why I need code which checks does field have content or not.
This is what I got now, but it adds "has_no_field" to all - no matter if field_image has content or not.
function theme_preprocess_views_view_unformatted(&$vars) {
$view = $vars['view'];
$rows = $vars['rows'];
foreach ($vars['view']->result as $id => $row) {
if (isset($row->field_image['und'][0]['value']) == 1) {
$vars['classes_array'][$id] = 'has_field';
}
else {
$vars['classes_array'][$id] = 'has_no_field';
}
}
}