How to use Views on custom route? Views require "Use AJAX" in order to display exposed filters when using Block display. I think this is necessary to avoid submitting/influencing other form elements on the current page.

I have a page that is a View but my page has to have a certain route name because my app relies on it. So I've used Block display for the Views instead of the Page display.

But I want the user to see the filtering arguments in URL so he can save the search or link to it. So obviously I will have to use the Page display for my view. But how can I use the Views with mine route?



Is is a good idea to create a Page view with some dummy path and load the View's route and get it's content and display it via mine route controller?



At first I've used the config option mentioned by Daniel Wehner but I ended up with using a custom filtering form + query tag. This gave me much better flexibility and customization options than Views' exposed filters.
There are a couple of things you can try out:


Write a display plugin for views which extends the  page one and allows you to specficy the route name in the UI. Note: views already uses a option in the view yml file 'route_name' if it is available:

display:
 page_1:
   display_options:
     path: node
     route_name: hallo_world


So you could just hack your yml file and be done.
Use the route alter event and simply rename the route generated by views:

protected function alterRoutes(RouteCollection $collection) {
  if ($route = $collection-&gt;get("view.$view_id.$display_id")) {
    $collection-&gt;remove("view.$view_id.$display_id"); // not sure about the method name.
    $collection-&gt;add('hey.this.is.my.cystom.route.name', $route);
  }
}

Be okay with the name views generates, as it won't change over time.