Hey all,

I'm trying to write a preprocess function to modify a theme depending on the value of a field.  I found something similar for Drupal 7 but it doesn't seem to work for Backdrop.. in fact, I can't seem to get anything in the function to fire.

I have added the following to my template.php:

function reiff_preprocess_views_view_list(&$variables) {
  if ($variables['view']->name == 'winners' && $variables['view']->current_display == "winners") {
    foreach($variables['view']->result as $key => $value){
        $variables['classes_array'][$key] .= ' hello';
    }
  }
}

As I understand it, this should add the "hello" class to each row on the view "winners" on the page display "winners", but as far as I can tell the function never fires.  I've confirmed the view and display names (view view-winners view-id-winners view-display-id-winners view-dom-id-e412b3e9e44f8ca2ca19fabd61da5b79 contextual-links-region), but I can't get the if statement to trigger when putting a break point in.

Anyone see what I'm doing wrong?  Any help would be greatly appreciated.

 

JB

 

Comments

I'm interested in this too, Does anyone have any answers for this one?