Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set the title from a views hook. #93

Open
stephen-cox opened this issue Jun 15, 2021 · 0 comments
Open

Unable to set the title from a views hook. #93

stephen-cox opened this issue Jun 15, 2021 · 0 comments

Comments

@stephen-cox
Copy link
Member

stephen-cox commented Jun 15, 2021

Setting the page title is done through the localgov_core.page_header_display event, but the PageHeaderDisplayEvent class only wraps an entity, meaning it's possible to change the page title depending on the current entity being displayed, but this doesn't allow changing the title when the page being displayed doesn't relate to a content entity, such as a view.

It should be possible to change the title of a page from a hook_views_pre_render function, but using the $view->setTitle() method sets the title in the header but not the page title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant