Render other attributes in views_display_switch template

Created on 16 January 2025, 3 months ago

Problem/Motivation

The template adds class views-display-switch in the template, so other attributes added to the render array are ignored.

Steps to reproduce

Add other classes or html attributes to the render array. Eg, preprocess views_display_switch or extend DisplaySwitch

Proposed resolution

Render {{ attributes }} in the template so all classes or html attributes are rendered.

Remaining tasks

User interface changes

None.\

API changes

If someone had overridden the template, its behaviour doesn't change for them. If someone changed the render array, it's possible they're relying on the template to add .views-display-switch, so that might be a breaking change.

Data model changes

None.

Feature request
Status

Active

Version

1.1

Component

Code

Created by

🇨🇦Canada travis-bradbury

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024