Problem/Motivation

By default the view settings class is applied globally, while it would be more useful if it were applied only to the container of the rows.
I realize this is a change to the default behavior of views, so it's just a proposal.

Proposed resolution

In views-view.html.twig from

<div{{ attributes.addClass(classes) }}>
...
{% if rows %}
    <div class="view-content">
      {{ rows }}
    </div>

to

<div{{ attributes.addClass(classes).removeClass(css_class|split(' ')) }}>
...
{% if rows %}
    <div class="{{ css_class }}">
      {{ rows }}
    </div>

Comments

maurizio_akabit created an issue. See original summary.

maurizio_akabit’s picture

Issue summary: View changes
arturopanetta’s picture

arturopanetta’s picture

  • arturopanetta committed 1450c86 on 8.x-0.x
    Issue #3222822 by maurizio_akabit: Change the main view template
    
arturopanetta’s picture

Status: Active » Needs review
arturopanetta’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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