Views in Drupal doesn’t seem to support a contextual filter value overriding the <title> of a view being displayed as a page. The heading on the page changes, but the title in the <head> of the document isn’t altered.

Here’s one way how to have a custom module take the view title (with the contextual filter override correctly inserted) and apply it to the route (page) title:

(Note that that is a very targeted hook_views_post_render function in a specific custom module and so it bails out early if the ID and display don’t match what we’re looking for. In a more general module you’d want to remove the early return call and instead wrap lines 13–15 in another if statement)

Phil Wolstenholme

I’m an accomplished developer with a wide range of skills, knowledge, and experience, particularly focussed on accessibility and frontend web performance.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store