function views_theme_suggestions_node_alter
Same name in other branches
- 9 core/modules/views/views.module \views_theme_suggestions_node_alter()
- 10 core/modules/views/views.module \views_theme_suggestions_node_alter()
- 11.x core/modules/views/views.module \views_theme_suggestions_node_alter()
Implements hook_theme_suggestions_HOOK_alter().
File
-
core/
modules/ views/ views.module, line 255
Code
function views_theme_suggestions_node_alter(array &$suggestions, array $variables) {
$node = $variables['elements']['#node'];
if (!empty($node->view) && $node->view->storage
->id()) {
$suggestions[] = 'node__view__' . $node->view->storage
->id();
if (!empty($node->view->current_display)) {
$suggestions[] = 'node__view__' . $node->view->storage
->id() . '__' . $node->view->current_display;
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.