Alter Views title programmatically on Drupal 8 | Drupal 8

Alter Views title programmatically on Drupal 8

Submitted by editor on Thu, 11/01/2018 - 14:48
Question

How to set title of a views page programmatically ?

function MYMODULE_views_pre_render(ViewExecutable $view) {
 if ($view->id() == 'ABC') {
  $view->setTitle('MY CUSTOM TITLE');
 }
}

Add new comment