1

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?

  • 1
    Try the internal path /taxonomy/term/123, the alias gets replaced by the internal path before routing. – 4k4 Jun 26 at 8:34
  • Thanks, that worked! If you add that as an answer I'll be happy to accept. – Patrick Kenny Jun 26 at 8:43
3

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

| improve this answer | |

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.