How can I set the template to use for a view page display? I created a view for my content, where fields are displayed as a page.
Scanning the source code, I noticed it uses the html--default--2.html.twig template.

I created a new custom template. how can I set that template for all the view pages, instead of the default template? I need to edit the whole page, including header and footer.

Notice that I've read this and this about custom templates for view.
I've tried to rename my custom template views-view--page.html.twig, and put it in my template folder, and also in /core/modules/views/templates, flushed cache, but nothing happens. My view page is still using the default template.
if you want to add new page template only for views:


Implement hook_theme_suggestions_page_alter like the following:




/**
 * Implements hook_theme_suggestions_page_alter().
 */
function mymodule_theme_suggestions_page_alter(&$suggestions, $variables) {
  //- Get the current route name.
  $route_name = \Drupal::routeMatch()->getRouteName();
  //- Check if the current route is a view.
  if (strpos($route_name, 'view') === 0) {
    //- Add suggestion to page when its a view page.
    $suggestions[] = 'page_views_view';
  }
}



Now in your views page you will have suggestions something like:

&lt;!-- FILE NAME SUGGESTIONS:
   x page-views-view.html.twig
   * page--en.html.twig
   * page--list-page.html.twig
   * page.html.twig
--&gt;



Now implement hook_theme like the following:




/**
 2. Implements hook_theme().
 */
function mymodule_theme($existing, $type, $theme, $path) {
  return [
    'page_views_view' => [
      'base hook' => 'page',
    ],
  ];
}




Then Create page-views-view.html.twig template inside templates folder in your module root folder.
Flush all cache.