Problem/Motivation
If the title of the grouped element is empty, the rows wrapper isn't rendered when u use a unformatted view. The behaviour changes when you use twig debugging, because then the title variable contains the debugging information which causes that the rows wrapper is indeed rendered.
Steps to reproduce
- Create a overview for articles
- Force fields on the view
- Group the view on the tags field
- Make sure you have some articles which are not linked to a tag
- Enable twig debugging. Verify that the __rows wrapper is renderd
- Disable twig debugging. Verify that the __rows wrapper is not renderd
Proposed resolution
In views-view-unformatted.html.twig change
{% if title %}
<div class="{{ bem_block }}__rows">
<h3 class="{{ bem_block }}__rows-title">{{ title }}</h3>
{% endif %}
to something like
{% if view.display_handler.getPlugin('style').options.grouping %}
<div class="{{ bem_block }}__rows">
{% if title %}
<h3 class="{{ bem_block }}__rows-title">{{ title }}</h3>
{% endif %}
{% endif %}
Remaining tasks
-
User interface changes
-
API changes
-
Data model changes
-
Comments
Comment #2
timohuismanComment #5
timohuismanThe patch contains a snapshot of the current state of the MR
Comment #6
timohuismanComment #7
timohuismanComment #8
casey commentedComment #11
bbrala