You are here

function node_row_node_view_preprocess_node in Views (for Drupal 7) 8.3

Same name and namespace in other branches
  1. 7.3 modules/node.views.inc \node_row_node_view_preprocess_node()

Implements hook_preprocess_node().

1 call to node_row_node_view_preprocess_node()
views_preprocess_node in ./views.module
A theme preprocess function to automatically allow view-based node templates if called from a view.

File

modules/node.views.inc, line 680
Provide views data and handlers for node.module.

Code

function node_row_node_view_preprocess_node(&$vars) {
  $node = $vars['node'];
  $options = $vars['view']->style_plugin->row_plugin->options;

  // Prevent the comment form from showing up if this is not a page display.
  if ($vars['view_mode'] == 'full' && !$vars['view']->display_handler
    ->hasPath()) {
    $node->comment = FALSE;
  }
  if (!$options['links']) {
    unset($vars['content']['links']);
  }
  if (!empty($options['comments']) && user_access('access comments') && $node->comment) {
    $vars['content']['comments'] = comment_node_page_additions($node);
  }
}