function views_theme_suggestions_comment_alter

views_theme_suggestions_comment_alter(array &$suggestions, array $variables)

Implements hook_theme_suggestions_HOOK_alter().

File

core/modules/views/views.module, line 276
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_theme_suggestions_comment_alter(array &$suggestions, array $variables) {
  $comment = $variables['elements']['#comment'];
  if (!empty($comment->view) && $comment->view->storage->id()) {
    $suggestions[] = 'comment__view__' . $comment->view->storage->id();
    if (!empty($comment->view->current_display)) {
      $suggestions[] = 'comment__view__' . $comment->view->storage->id() . '__' . $comment->view->current_display;
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!views!views.module/function/views_theme_suggestions_comment_alter/8.1.x