I have function in template.php which check if image fields exists (has content) and it adds classes if image exists (has_field) and if image does not exist (has_no_field).
This function now works with Unformatted format, but I need it to work with HTML list format. I already tried it with function theme_views_pre_render(&$view) but could not get it to work.
function theme_preprocess_views_view_unformatted(&$vars) {
$view = $vars['view'];
$rows = $vars['rows'];
foreach ($vars['view']->result as $id => $row) {
if (!empty($row->field_field_image) || !empty($row->field_field_image_2) || !empty($row->field_field_image_3)) {
$vars['classes_array'][$id] .= ' has_field';
}
else {
$vars['classes_array'][$id] .= ' has_no_field';
}
}
}
How to make this work with HTML list format?