8

I would like to change my Views (page display) title programmatically.

For Drupal 6 I found Setting the View-Title programmatically in Views2, but it doesn't work for me.

    function mymodule_views_pre_build(&$view) {
  if ($view->name == 'view_machine_name') {
    $view->display['display_machine_name']->handler->options['title'] = 'New Display Title';
  }
}

Browse other questions tagged or ask your own question.