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

-

CommentFileSizeAuthor
#5 3487536-3.patch976 bytestimohuisman

Issue fork bem-3487536

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

timohuisman created an issue. See original summary.

timohuisman’s picture

Issue summary: View changes

timohuisman’s picture

StatusFileSize
new976 bytes

The patch contains a snapshot of the current state of the MR

timohuisman’s picture

Status: Active » Needs review
timohuisman’s picture

casey’s picture

Status: Needs review » Reviewed & tested by the community

bbrala made their first commit to this issue’s fork.

  • bbrala committed 7947d8c6 on 8.x-3.x authored by timohuisman
    Issue #3487536 by timohuisman, rhezios, casey, bbrala: Rows wrapper in...
bbrala’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.