I have a view showing taxonomy terms with an images field. I'd like to add a class .has-images if the images field is not empty.
I've done this before with nodes using preprocess, have tried something similar and have looked around for an answer though I can't seem to get it to work. Also where would the code go? would it go in a view.preprocess.inc file?
This is an example of node.preprocess.inc
function THEMENAME_preprocess_node(&$vars) {
if(!empty($vars['field_images'])) {
$vars['classes_array'][] = 'has-images';
}
}
Any help would be much appreciated.