Problem/Motivation

HTML classes should be usually added in templates instead of preprocess functions.

Proposed resolution

Move the HTML classes from the preprocess function to the template. The classes should be added in a template checkboxes.html.twig file.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

Hardik_Patel_12 created an issue. See original summary.

hardik_patel_12’s picture

Issue summary: View changes
hardik_patel_12’s picture

StatusFileSize
new1.27 KB

Kindly review a new patch.

hardik_patel_12’s picture

Assigned: hardik_patel_12 » Unassigned
Status: Needs work » Needs review
siddhant.bhosale’s picture

Assigned: Unassigned » siddhant.bhosale
siddhant.bhosale’s picture

StatusFileSize
new1.13 MB

I have tested the patch and looks good to be merged.
The classes are being added from the checkboxes.html.twig file.

Adding the screenshot below, which shows the class is added.

siddhant.bhosale’s picture

Assigned: siddhant.bhosale » Unassigned
Status: Needs review » Reviewed & tested by the community

  • lauriii committed 5a9de59 on 9.0.x
    Issue #3105580 by Hardik_Patel_12, siddhant.bhosale: Move HTML classes...

  • lauriii committed 52a3220 on 8.9.x
    Issue #3105580 by Hardik_Patel_12, siddhant.bhosale: Move HTML classes...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed 5a9de59 and pushed to 9.0.x and 8.9.x. Thanks!

Refrained from backporting to 8.8.x since this is adding a new template.

Status: Fixed » Closed (fixed)

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