<?php
/**
* Implements hook_theme_suggestions_HOOK_alter().
*
* This hook for adding a custom suggestion page template.
*
* Place this function in your THEME_NAME.theme file.
* then you can use the template page--[content-type].html.twig
*
* Tested and worked with Drupal Version 8.3.x
*/
function THEME_NAME_theme_suggestions_page_alter(array &$suggestions, array $variables) {
if ($node = \Drupal::routeMatch()->getParameter('node')) {
$content_type = $node->bundle();
$suggestions[] = 'page__'.$content_type;
}
}