Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
It would be a useful feature if field group would provide option for setting field group label classes at least.
Proposed resolution
Add a new setting for config form and use it on render.
Remaining tasks
Provide a patch.
User interface changes
New "label_element_classes" option on settings from which is used at form group render.
Comment | File | Size | Author |
---|---|---|---|
#7 | field_group-group_label_class-2863821-7.patch | 5.09 KB | John Pitcairn |
#3 | field_group-group_label_class-2863821-3.patch | 5.52 KB | huzooka |
#2 | field_group-group_label_class-2863821-2.patch | 5.52 KB | huzooka |
Comments
Comment #2
huzookaComment #3
huzookaWrong variable used for adding the collabsible class.
Comment #4
huzookaComment #5
John Pitcairn CreditAttribution: John Pitcairn commentedJust what I needed, when I needed it, thanks. Works well, I'm not seeing any issues. I guess we need to wait for the branch to pass and tests to run before marking this RTBC?
Comment #6
John Pitcairn CreditAttribution: John Pitcairn commentedPatch no longer applies to 8.x-1.x-dev
Comment #7
John Pitcairn CreditAttribution: John Pitcairn commentedPatch re-rolled to remove the section patching the
$element['##attributes']['class'][]
double hash typo that has already been fixed in dev. No other changes.Comment #8
darvanenDrupal code standards require new line at end of files.My bad, patch inserts the newline.
Comment #9
darvanenApplies cleanly to 8.x-3.x, works well and code is good.
Recommend commit ASAP.
Test failures are unrelated to this patch.
Comment #10
leymannxPlease merge this feature soon. Nearly same time as the last comment somebody started to build its own module for that: https://www.drupal.org/project/projectapplications/issues/2973303
Comment #11
dercheffe+1 please commit it :)
Comment #13
nils.destoop CreditAttribution: nils.destoop as a volunteer and at Wunder commentedThx for the patch. I committed it to dev, and also added some testing.