How to override Page Title of View using Contextual Filter I have a view that uses a contextual filter for part of the URL. For example: www.example.com/categories/%/all

I have successfully replaced the % with the name of the taxonomy term from a specific category (for example, www.example.com/categories/shirts/all), but I cannot get the Title Override options to work.

Here's how I have things set up...

Contextual Filter - Indexed Content: Clothing Categories
When the filter value is NOT in the URL -  Display empty text 
Override title - %1
Specify validation criteria: Validator: Taxonomy Term
Filter value type - Term Name Converted to Term ID
Transform dashes in URL to spaces in term name filter values  (checked)


When I preview the View result by typing the contextual filter "shirts", it does display the shirts and it does display the title "Shirts". However, on the live page, the View's title is displayed instead ("Category View"). I have tried deleting the View's title, but that just causes the front-end page to display no title.

Any idea on how I can get this to work, or any other methods to make it work?

Thanks!
In Drupal 8, if you are using a contextual filter to pass a taxonomy term to a View and want to change the page title to match with the term title, you can:

/**
 * Implements hook_preprocess_views_view().
 */
function HOOK_preprocess_views_view(&amp;$variables) {

  $id = $variables['id'];

  if( $id == 'YOUR_VIEW_NAME' &amp;&amp; $variables['view']-&gt;args[0]) {

    // Get tid from contextual argument of the view
    $tid = $variables['view']-&gt;args[0];

    // Load the Term Entity
    $term = Term::load($tid);

    // Term Title
    $new_title = $term-&gt;getName();

    // Set the new Page Title
    $request = \Drupal::request();
    if ($route = $request-&gt;attributes-&gt;get(\Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_OBJECT)) {
      $route-&gt;setDefault('_title', $new_title);
    }
  }
}