diff --git a/core/modules/views/templates/views-view-fields.html.twig b/core/modules/views/templates/views-view-fields.html.twig index 03f97be..38525c7 100644 --- a/core/modules/views/templates/views-view-fields.html.twig +++ b/core/modules/views/templates/views-view-fields.html.twig @@ -26,6 +26,12 @@ * @ingroup themeable */ #} + {% for field in fields %} {{ field.separator }} diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index e1b1eb7..7e5fcd5 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -312,6 +312,38 @@ function template_preprocess_views_view_fields(&$vars) { } /** + * Returns HTML for multiple views fields. + * + * @param $variables + * An associative array containing: + * - separator: A string that separates the fields. + * - wrapper_suffix: A string added to the beginning of the fields. + * - label_html: An HTML string that labels the fields. + * - content: The fields. + * - wrapper_suffix: A string added to the end of the fields. + * + * @see template_preprocess_views_view_fields() + */ +function theme_views_view_fields($vars) { + $fields = $vars['fields']; + $output = ''; + + foreach ($fields as $id => $field) { + if (!empty($field->separator)) { + $output .= $field->separator; + } + + $output .= $field->wrapper_prefix; + $output .= $field->label_html; + $output .= $field->content; + + $output .= $field->wrapper_suffix; + } + + return $output; +} + +/** * Process a single grouping within a view. */ function template_preprocess_views_view_grouping(&$vars) {