diff --git a/core/modules/views/templates/views-view-summary.html.twig b/core/modules/views/templates/views-view-summary.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..cffc2bc869324e32db8d26a96519cac19ad40ae0 --- /dev/null +++ b/core/modules/views/templates/views-view-summary.html.twig @@ -0,0 +1,34 @@ +{# +/** + * @file + * Default theme implementation to display a list of summary lines. + * + * Available variables: + * - rows: The rows contained in this view. + * Each row contains: + * - url: The summary link URL. + * - link: The summary link text. + * - count: The number of items under this grouping. + * - row_classes: HTML classes to apply to each row, indexed by row ID. + * This matches the index in rows. + * - options: Flags indicating how the summary should be displayed. + * This contains: + * - count: A flag indicating whether the count should be displayed. + * + * @see template_preprocess() + * @see template_preprocess_views_view_summary() + * + * @ingroup themeable + */ +#} +
+ +
diff --git a/core/modules/views/templates/views-view-summary.tpl.php b/core/modules/views/templates/views-view-summary.tpl.php deleted file mode 100644 index ce51e708ac373b0f04027a2ce53d97c6087528c9..0000000000000000000000000000000000000000 --- a/core/modules/views/templates/views-view-summary.tpl.php +++ /dev/null @@ -1,20 +0,0 @@ - -
- -
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 88499b37a40b13c5a7470ae295fec27b16e51042..21de05ca1f54724a7b1b004c8646e4d9851a8f2d 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -328,10 +328,19 @@ function template_preprocess_views_view_field(&$vars) { } /** - * Preprocess theme function to print a single record from a row, with fields + * Prepares variables for views summary templates. + * + * The summary prints a single record from a row, with fields. + * + * Default template: views-view-summary.html.twig. + * + * @param array $vars + * An associative array containing: + * - view: A ViewExecutable object. + * - rows: The raw row data. */ function template_preprocess_views_view_summary(&$vars) { - $view = $vars['view']; + $view = $vars['view']; $argument = $view->argument[$view->build_info['summary_level']]; $vars['row_classes'] = array(); @@ -346,8 +355,9 @@ function template_preprocess_views_view_summary(&$vars) { url(current_path()), // could be an alias )); - // Collect all arguments foreach row, to be able to alter them for example by the validator. - // This is not done per single argument value, because this could cause performance problems. + // Collect all arguments foreach row, to be able to alter them for example + // by the validator. This is not done per single argument value, because this + // could cause performance problems. $row_args = array(); foreach ($vars['rows'] as $id => $row) { @@ -356,7 +366,6 @@ function template_preprocess_views_view_summary(&$vars) { $argument->process_summary_arguments($row_args); foreach ($vars['rows'] as $id => $row) { - $vars['rows'][$id]->link = $argument->summary_name($row); $args = $view->args; $args[$argument->position] = $row_args[$id]; @@ -367,7 +376,6 @@ function template_preprocess_views_view_summary(&$vars) { } $vars['rows'][$id]->url = url($view->getUrl($args, $base_path), $url_options); $vars['rows'][$id]->count = intval($row->{$argument->count_alias}); - $vars['row_classes'][$id] = array(); if (isset($active_urls[$vars['rows'][$id]->url])) { $vars['row_classes'][$id]['class'][] = 'active';