This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implementation of hook_theme_suggestions_HOOK_alter() for page.html.twig. | |
*/ | |
function MYTHEME_theme_suggestions_page_alter(array &$suggestions, array $variables) { | |
// Add template suggestions based on the current node entity content type. | |
$key = array_search('page__node', $suggestions); | |
if ($key !== FALSE && ($node = \Drupal::routeMatch()->getParameter('node'))) { | |
$content_type = $node->bundle(); | |
array_splice($suggestions, ++$key, 0, array('page__node_type__%', 'page__node_type__'.$content_type)); |
NewerOlder