function ViewsThemeHooks::preprocessViewsViewGrouping

Prepares variables for views single grouping templates.

Default template: views-view-grouping.html.twig.

Parameters

array $variables: An associative array containing:

  • view: The view object.
  • rows: The rows returned from the view.
  • grouping_level: Integer indicating the hierarchical level of the grouping.
  • content: The content to be grouped.
  • title: The group heading.

File

core/modules/views/src/Hook/ViewsThemeHooks.php, line 434

Class

ViewsThemeHooks
Hook implementations for views.

Namespace

Drupal\views\Hook

Code

public function preprocessViewsViewGrouping(array &$variables) : void {
  $variables['content'] = $variables['view']->style_plugin
    ->renderGroupingSets($variables['rows'], $variables['grouping_level']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.