Question

I have two views in Drupal 8.

  1. The standard Taxonomy term (content) view, path: /taxonomy/term/%
  2. My custom view for just one term at path: /term-alias

When I go to my custom term, I see the view for all terms (#1), when I want to force it to #2. How can I do that?

Was it helpful?

Solution

Use the internal path of the term:

/taxonomy/term/123

Route matching operates only on internal (unaliased) paths and route #2 having more fixed parts wins.

See https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Routing%21RouteCompiler.php/function/RouteCompiler%3A%3AgetFit/9.0.x

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top