Commit ed042be0 authored by alexpott's avatar alexpott

Issue #1843752 by joelpittet, Sean Charles: Convert...

Issue #1843752 by joelpittet, Sean Charles: Convert views/templates/views-view-grouping.tpl.php to twig.
parent 94147940
{#
/**
* @file
* Default theme implementation to display a single views grouping.
*
* Available variables:
* - view: The view object.
* - grouping: The grouping instruction.
* - grouping_level: A number indicating the hierarchical level of the grouping.
* - title: The group heading.
* - content: The content to be grouped.
* - rows: The rows returned from the view.
*
* @see template_preprocess()
* @see template_preprocess_views_view_grouping()
*
* @ingroup themeable
*/
#}
<div class="view-grouping">
<div class="view-grouping-header">{{ title }}</div>
<div class="view-grouping-content">{{ content }}</div>
</div>
<?php
/**
* @file
* This template is used to print a single grouping in a view.
*
* It is not actually used in default Views, as this is registered as a theme
* function which has better performance. For single overrides, the template is
* perfectly okay.
*
* Variables available:
* - $view: The view object
* - $grouping: The grouping instruction.
* - $grouping_level: Integer indicating the hierarchical level of the grouping.
* - $rows: The rows contained in this grouping.
* - $title: The title of this grouping.
* - $content: The processed content output that will normally be used.
*/
?>
<div class="view-grouping">
<div class="view-grouping-header"><?php print $title; ?></div>
<div class="view-grouping-content">
<?php print $content; ?>
</div>
</div>
......@@ -296,8 +296,19 @@ function template_preprocess_views_view_fields(&$vars) {
}
/**
* Process a single grouping within a view.
*/
* Prepares variables for views single grouping templates.
*
* Default template: views-view-grouping.html.twig.
*
* @param array $vars
* 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.
*/
function template_preprocess_views_view_grouping(&$vars) {
$vars['content'] = $vars['view']->style_plugin->render_grouping_sets($vars['rows'], $vars['grouping_level']);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment