How to get page type in page.html.twig I need to set some classes in page.html.twig based on page type (node, view, etc..) and if possible in more details (node type 'article', view 'blog') etc.

some ideas how to do this? I can't figure out how to get that done in page.html.twig?!

thank you! 
Matthias
There is no page type in Drupal 8. But you can get the route name in a page preprocess hook to identify the type of page:

Route name

function mytheme_preprocess_page(&amp;$variables) {
  $variables['route_name'] = \Drupal::routeMatch()-&gt;getRouteName();
}


and in twig:

{{ route_name }}


Route parameters

For route parameters:

 if ($node = \Drupal::routeMatch()-&gt;getParameter('node')) {
    $variables['node'] = $node;
  }


This code for the node is already in theme.inc, so you can use it right away in twig to get the content type:

{{ node.gettype }}


The node is the only route parameter that is loaded by default. You have to get parameters from other routes in preprocess, for example the view id and display id from a view route:

function mytheme_preprocess_page(&amp;$variables) {
  $variables['view_id'] = \Drupal::routeMatch()-&gt;getParameter('view_id');
  $variables['display_id'] = \Drupal::routeMatch()-&gt;getParameter('display_id');
}