Coder1
Coder1

Reputation: 13321

Set current display title from the $views object

I'm doing some work in hook_views_query_alter() and from there I have access to the $views and $query objects by reference.

I am altering the query, but there's a bit of logic that I'd like to keep in the same place to modify the title of this display (it's a block).

My display object is this: $view->display[$view->current_display]

I just can't seem to figure out how to change the display title from that.

Upvotes: 1

Views: 617

Answers (1)

Juhani
Juhani

Reputation: 83

You should be able to change it from build_info.

$view->build_info['title'] = "New title";

Upvotes: 2

Related Questions