You are here

function node_theme_suggestions_node in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/node.module \node_theme_suggestions_node()

Implements hook_theme_suggestions_HOOK().

File

core/modules/node/node.module, line 545
The core module that allows content to be submitted to the site.

Code

function node_theme_suggestions_node(array $variables) {
  $suggestions = array();
  $node = $variables['elements']['#node'];
  $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
  $suggestions[] = 'node__' . $sanitized_view_mode;
  $suggestions[] = 'node__' . $node
    ->bundle();
  $suggestions[] = 'node__' . $node
    ->bundle() . '__' . $sanitized_view_mode;
  $suggestions[] = 'node__' . $node
    ->id();
  $suggestions[] = 'node__' . $node
    ->id() . '__' . $sanitized_view_mode;
  return $suggestions;
}