Adding attributes to views-view-list.html.twig doesn't work if Views List class Style option is empty

Created on 20 January 2017, over 8 years ago
Updated 15 March 2023, over 2 years ago

While theming a views-view-list.html.twig file I noticed adding a class to the list.attributes didn't work on line 28 of views-view-list.html.twig:
<{{ list.type }}{{ list.attributes.addClass('some-class') }}>

The issue seems to be that since I don't have any classes added to the List class field in the Format > Settings > Style options for my HTML List the list.attributes is never instantiated as an Attribute.

๐Ÿ› Bug report
Status

Needs work

Version

10.1 โœจ

Component
Viewsย  โ†’

Last updated about 23 hours ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States daniel korte Brooklyn, NY

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024