1

I have a view with a contextual filter, and a few tabs corresponding to a taxonomy. In my module.links.menu.yml I have something like this:

mymodule.apple_view:
  title: 'List of apples'
  route_name: view.fruit_view.page_1
  route_parameters: { fruittype: 'apple' }
  menu_name: main

So I have my tab "List of apples", but the URL has the form http://localhost/it/fruit_view?fruittype=apple (which works), but I'd rather have it as http://localhost/it/fruit_view/apple (which also works). I suppose there may be a parameter for .link.menu.yml to achieve this, but I cannot find the full documentation. I checked the documentation and the source, but that didn't help. Any suggestion?

0

Never mind - solved it. In the view definition, I changed the path from /fruit_view to /fruit_view/%fruittype, and I got the URLs as I wanted them. I also had to remove the menu voice defined in the view, but that's not a problem, since I have to redefine the filtered ones anyway.

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.