When pre-rendering a view row is there a way to add an HTML class into a single row of the markup, allowing me to add a new background colour to the event item highlighting its importance? This is for the calendar module monthly view
For example,
<div class="row"></div> <div class="row this-item-was-added-using-view-views_pre_render"></div> <div class="row"></div>
Below the is the what I have so far.
function pnc_views_overrides_views_pre_render(DrupalviewsViewExecutable $view) { if ((int)Drupal::currentUser()->id() === 1) { foreach ($view->result as $key => $value) { try { $field_result_value = $value->_entity->field_display->getValue(); if (isset($field_result_value[0]) && (int)$field_result_value[0]['value'] === 1) { // add a class to the change the background color to hi-light its importance } } catch (Exception $e) { Drupal::logger('viewoveride_pnc_cal_views_overrides')->error($e->getMessage()); } } } }