Skip to content

Instantly share code, notes, and snippets.

View vrwired's full-sized avatar

Bob Rohrer vrwired

  • Roaring Enterprises, LLC
  • Denver CO
View GitHub Profile
@ValeriiVasyliev
ValeriiVasyliev / drupal8-change-view-field-value.md
Created August 19, 2017 08:41
Drupal 8. Change View Field Value

Method 1

/**
 * Implements hook_views_pre_render().
 */
function hook_views_pre_render(&$view) {
  if ($view->name == 'myview') {
    foreach ($view->result as &$row) {
 $row->field_myfield[0]['rendered']['#markup'] = $row->field_myfield[0]['rendered']['#markup'] ? t('Yes') : t('No');