protected function SlickGrouping::renderRowGroup in Slick Views 8.2
Overrides StylePluginBase::renderRowGroup().
1 call to SlickGrouping::renderRowGroup()
- SlickGrouping::renderGroupingSets in src/
Plugin/ views/ style/ SlickGrouping.php - Overrides StylePluginBase::renderGroupingSets().
File
- src/
Plugin/ views/ style/ SlickGrouping.php, line 142
Class
- SlickGrouping
- Slick style plugin with grouping support.
Namespace
Drupal\slick_views\Plugin\views\styleCode
protected function renderRowGroup(array $rows = [], $level = 0) {
$view = $this->view;
$settings = $this->options;
$view_name = $view->storage
->id();
$view_mode = $view->current_display;
$plugin_id = $this
->getPluginId();
$grouping = empty($settings['grouping']) ? [] : array_filter($settings['grouping']);
$id = $grouping ? "{$view_name}-{$view_mode}-{$level}" : "{$view_name}-{$view_mode}";
$id = Blazy::getHtmlId($plugin_id . '-views-' . $id, $settings['id']);
$settings = $this
->buildSettings();
// Prepare needed settings to work with.
$settings['id'] = $id;
if (empty($grouping) && empty($settings['grouping_optionset'])) {
$settings['nav'] = !$settings['vanilla'] && $settings['optionset_thumbnail'] && isset($view->result[1]);
}
$build = $this
->buildElements($settings, $rows);
// Extracts Blazy formatter settings if available.
if (empty($settings['vanilla']) && isset($build['items'][0])) {
$this
->blazyManager()
->isBlazy($settings, $build['items'][0]);
}
// Supports Blazy multi-breakpoint images if using Blazy formatter.
$settings['first_image'] = isset($rows[0]) ? $this
->getFirstImage($rows[0]) : [];
$build['settings'] = $settings;
return $this->manager
->build($build);
}