/**
* Implements hook_theme_suggestions_page_alter().
*/
function my_module_theme_suggestions_page_alter(array &$suggestions, array $variables) {
$node_revision = \Drupal::routeMatch()->getParameter('node_revision');
$node = $node_revision
? \Drupal::entityTypeManager()->getStorage('node')->loadRevision($node_revision)
: \Drupal::routeMatch()->getParameter('node');
if ($node instanceof NodeInterface) {
$content_type = $node->bundle();
$suggestions[] = 'page__'.$content_type;
}
}
Created
April 5, 2021 20:38
-
-
Save fredysan/211eef2839b811102f0785ffcdeb135f to your computer and use it in GitHub Desktop.
Theme Suggestions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment