Commit e6147874 authored by alexpott's avatar alexpott

Issue #1963420 by jibran: Improve DX when writing style plugins by adding a...

Issue #1963420 by jibran: Improve DX when writing style plugins by adding a groupingTheme variable .
parent ebfdf7fd
......@@ -82,6 +82,18 @@ abstract class StylePluginBase extends PluginBase {
*/
protected $rendered_fields;
/**
* The theme function used to render the grouping set.
*
* Plugins may override this attribute if they wish to use some other theme
* function to render the grouping set.
*
* @var string
*
* @see StylePluginBase::render_grouping_sets()
*/
protected $groupingTheme = 'views_view_grouping';
/**
* Overrides \Drupal\views\Plugin\views\PluginBase::init().
*
......@@ -445,7 +457,7 @@ function render() {
*/
function render_grouping_sets($sets, $level = 0) {
$output = array();
$theme_functions = views_theme_functions('views_view_grouping', $this->view, $this->view->display_handler->display);
$theme_functions = views_theme_functions($this->groupingTheme, $this->view, $this->view->display_handler->display);
foreach ($sets as $set) {
$row = reset($set['rows']);
// Render as a grouping set.
......
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