0

I have user views page with path /members/%. (url as members/term-name).It shows if I use CONTEXTUAL FILTERS with term id but I need url with term name.
Anyway , go back to story: academician,math, math teacher, math students are terms. It shows all members if path is members/math or members/academician.
No problem with one word term name. But it doesn't show any member if url is members/math-teacher or members/math-student.
So it works with math terms but not with math teacher.
What am I missing ?
enter image description here
enter image description here

  • Did you change the route in some way? The term id is still in the URL behind any alias you made (with Pathauto). If not, term id will always pull the value. – Kevin Dec 22 '18 at 18:45
  • Yes pathauto is enable and taxonomy pattern as [term:vocabulary]/[term:name] . Does it effect views ? Sorry if something misunderstood. View works with term id. I add this info to show main view structure is ok. But I need structure with term-name contextual filter. math-teacher's term id is 883 Scenario 1:If I build structure with term id (as domain.com/members/883). I see all math teacher. Scenario 2: No result if I build views structure with term name (as domain.com/members/math-teacher) – iberx Dec 22 '18 at 18:59
  • Scenario 3: I see all math teachers if I change term name math teacher to math as one word.(as domain.com/members/math) – iberx Dec 22 '18 at 19:01
0


In views, the multi-word term is a well-known active issue

Solution 1:
You can use pathauto module to set up automatic aliases for your taxonomy terms.

Solution 2:
From views:

  • Choose "Specify validation criteria" in settings of Taxonomy Term Contextual filter.
  • Then Choose Taxonomy Term in Validator field.
  • Choose your Vocabulary.
  • Choose Term name converted to term ID in Filter Value Type Field.
    Please see attached screenshots for solution 2:

    screenshot one
    screenshot two


    Solution 3: In views, you can create path aliases for term IDs by using view_alias module.
  • Perhaps I am missing something but could TVI module solve this problem? – Kevin Jan 11 at 15:29
0

Thanks johirpro,
Patch at your first link worked for me with my settings(below). Many many thanks

Contextual Filters(with relationship)
Provide default value-Term id from URL
Specify validation criteria-Basic Validation+Show Page not found.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.