diff --git a/core/modules/views/templates/views-view-table.html.twig b/core/modules/views/templates/views-view-table.html.twig index 903b059..6ee4e7f 100644 --- a/core/modules/views/templates/views-view-table.html.twig +++ b/core/modules/views/templates/views-view-table.html.twig @@ -107,11 +107,16 @@ {% endfor %} {% endif %} - {{- column.content }}{{ column.separator -}} {%- if column.wrapper_element -%} - <{{ column.wrapper_element }}>{{ column.field_output }} + <{{ column.wrapper_element }}> + {% for content in column.content %} + {{ content.separator }}{{ content.field_output }} + {% endfor %} + {%- else -%} - {{- column.field_output -}} + {% for content in column.content %} + {{- content.separator }}{{ content.field_output -}} + {% endfor %} {%- endif %} {% endfor %} diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 1c82c2a..7d5e182 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -579,12 +579,24 @@ function template_preprocess_views_view_table(&$variables) { if (!empty($fields[$field])) { $field_output = $handler->getField($num, $field); $column_reference['wrapper_element'] = $fields[$field]->elementType(TRUE, TRUE); + if (!isset($column_reference['content'])) { + $column_reference['content'] = []; + } - $column_reference['field_output'][] = ['#markup' => $field_output]; // Only bother with separators and stuff if the field shows up. // Place the field into the column, along with an optional separator. - if (trim($field_output) != '' && !empty($column_reference['content']) && !empty($options['info'][$column]['separator'])) { - $column_reference['field_output'][] = ['#markup' => $options['info'][$column]['separator']]; + if (trim($field_output) != '') { + if (!empty($column_reference['content']) && !empty($options['info'][$column]['separator'])) { + $column_reference['content'][] = [ + 'separator' => ['#markup' => $options['info'][$column]['separator']], + 'field_output' => ['#markup' => $field_output] + ]; + } + else { + $column_reference['content'][] = [ + 'field_output' => ['#markup' => $field_output] + ]; + } } } $column_reference['attributes'] = new Attribute($column_reference['attributes']); diff --git a/core/themes/classy/templates/views/views-view-table.html.twig b/core/themes/classy/templates/views/views-view-table.html.twig index 067d5ba..70f205b 100644 --- a/core/themes/classy/templates/views/views-view-table.html.twig +++ b/core/themes/classy/templates/views/views-view-table.html.twig @@ -107,11 +107,16 @@ {% endfor %} {% endif %} - {{- column.content }}{{ column.separator -}} {%- if column.wrapper_element -%} - <{{ column.wrapper_element }}>{{ column.field_output }} + <{{ column.wrapper_element }}> + {% for content in column.content %} + {{ content.separator }}{{ content.field_output }} + {% endfor %} + {%- else -%} - {{- column.field_output -}} + {% for content in column.content %} + {{- content.separator }}{{ content.field_output -}} + {% endfor %} {%- endif %} {% endfor %}