node_theme_suggestions_node

node_theme_suggestions_node(array $variables)

Implements hook_theme_suggestions_HOOK().

File

core/modules/node/node.module, line 542
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;
}
doc_Drupal
2016-10-29 09:31:59
Comments
Leave a Comment

Please login to continue.