2

I have a Taxonomy Vocabulary as People. In it there are two terms Board and Staff. I've created a view with two displays, to display the people content with respect to taxonomy terms. The view title is Board Members.

I want to change the staff display title to be like Staff Members? How to change it?

I've filtered by using Contextual filters.

2
  • Do you use 2 page displays for this view? Commented Oct 25, 2013 at 7:19
  • Yes two pages with single view Commented Oct 25, 2013 at 7:22

2 Answers 2

3
  1. In the contextual filters click on override title and set it to %1
  2. Specify validation criteria to taxonomy term and select the vocabulary
  3. Leave the views title empty.

This will set the present's term's title as the view's title.

If need you can add "text" %1 to display the text appended to the term's name.

8
  • 1
    Don't forget to make sure he will overwrte defaults, not update them. If he will update them, he will end up with both displays titled "Staff Members" Commented Oct 25, 2013 at 7:30
  • 1
    @dinesh : "Yes two pages with single view", the pages are called as displays in views. Commented Oct 25, 2013 at 8:05
  • 1
    Did you try the one here drupal.stackexchange.com/questions/11760/dynamic-views-title Commented Oct 25, 2013 at 8:11
  • 1
    Thnaks @Gladiator I did little more work to got the result. 1.I left the view display name as blank. 2.In contextual filter, under When the filter value IS in the URL or a default is provided, checked override title, and placed %1. this gives me the terms as titles as board and staff. So i changed the term names (Board Members and Staff Members) add changed the alias and done! Commented Oct 25, 2013 at 8:53
  • 1
    Hello again, guys :) Could you please edit what you figured in comments, @Dhinesh to a question and Gladiator to an answer, respectively? You know, for future readers. Commented Oct 25, 2013 at 9:03
0

Another method add this code in the template.php

 function template_preprocess_page(&$variables) { $current_path = drupal_get_path_alias(); if($current_path == 'people/staff') { drupal_set_title('Staff Members'); } } 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.