function views_preprocess_comment

views_preprocess_comment(&$variables)

A theme preprocess function to automatically allow view-based node templates if called from a view.

File

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

Code

function views_preprocess_comment(&$variables) {
  // The view data is added to the comment in
  // \Drupal\views\Plugin\views\row\EntityRow::preRender().
  if (!empty($variables['comment']->view) && $variables['comment']->view->storage->id()) {
    $variables['view'] = $variables['comment']->view;
  }
}

© 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_preprocess_comment/8.1.x