Page template suggestion based on content types but not for node/edit or node/delete I have a template for a page content type that works perfect. But when I try to edit or delete the node of that content type it blocks the standard template.

So node/130/edit? or node/130/delete? are not working because I don't get the right page.

I tried strpos($_SERVER['REQUEST_URI']) versions but it doesn't work or like the one below only gives me the "original" Drupal template  when the path is node/130/edit? so the second variable gets through.

function mytheme_theme_suggestions_page_alter(array &amp;$suggestions, array $variables) {
      // Add content type suggestions.
      if (($node = \Drupal::request()-&gt;attributes-&gt;get('node')) &amp;&amp; 
      (strpos($_SERVER['REQUEST_URI'], "delete") || strpos($_SERVER['REQUEST_URI'], "edit") === false)
      ) {
        array_splice($suggestions, 1, 0, 'page__node__' . $node-&gt;getType());
      }
    }


The array_splice hint comes from
https://www.drupal.org/forum/support/theme-development/2015-07-02/how-to-add-in-drupal-8-a-custom-suggestion-page-template#comment-10684366

Any help?
A slightly different approach: Add a custom theme suggestion for the canonical route of your node type(s).

This way, you neither have to meddle with path arguments whose position might change, e.g. when using subpath aliases in a later stage of your site's development cycle, nor have to extend your checks for additional routes added by third party modules, as e.g. node/{nid}/translate, node/{nid}/revisions, node/{nid}/devel, and so on.

I didn't test it though, but you could do something like this:

/**
 * Implements hook_theme_suggestions_HOOK_alter() for page.html.twig.
 */
function mytheme_theme_suggestions_page_alter(array &amp;$suggestions, array $variables) {
  if (
    $route_name = \Drupal::routeMatch()-&gt;getRouteName()
    &amp;&amp; $route_name == 'entity.node.canonical'
    &amp;&amp; $node = \Drupal::request()-&gt;attributes-&gt;get('node')
  ) {
    $suggestions[] = 'page__node__' . $node-&gt;getType() . '__canonical';
  }
}


Then you could rename your page template to page--node--my-type--canonical.html.twig and it should be picked up only for your node type my_type at its canonical (view) route.