In D8, I have a need to dynamically set the title of a views page display.
I've tried implementing both hook_views_pre_render
and hook_views_post_build
and setting the value of $view->build_info['title']
, but Drupal seems to be ignoring it when setting the page title.
It seems like the code in Views where the title is set is in Drupal\views\Plugin\views\display\Page::execute()
The #title property on the render array in that method IS receiving my overwritten value from one of my hooks, but it's still ignore and is using the manually specified title on the display config.
What is going on!?