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.
The 6.x fieldgroup module would output the machine name of the group as a CSS class in the fieldset.
For example, if the machine name is group_my_group, the class would be 'group-my-group'.
This helped with js events (for example, opening a fieldset when certain conditions are met in another field).
Comment | File | Size | Author |
---|---|---|---|
#3 | 1049434_machine_class.patch | 466 bytes | nils.destoop |
Comments
Comment #1
Stalski CreditAttribution: Stalski commentedIndeed. Will be fixed asap.
Comment #2
nils.destoop CreditAttribution: nils.destoop commentedComment #3
nils.destoop CreditAttribution: nils.destoop commentedThe group name has been added as css class. Committed to dev, in attachment theres a patch
Comment #4
nils.destoop CreditAttribution: nils.destoop commentedComment #5
jhedstromAwesome. Thanks!
Comment #6
Stalski CreditAttribution: Stalski commentedComment #7
anniegreens CreditAttribution: anniegreens commentedIt appears that this was altered in the latest dev release (7.x-1.1+67-dev). Why? CSS previously using something like 'group-legal' must now be changed to 'group_legal', the machine name. This is not proper use of
drupal_html_class
, which lower cases and dashifies strings.Comment #8
anniegreens CreditAttribution: anniegreens commentedSorry. Re-opening.
Comment #9
anniegreens CreditAttribution: anniegreens commentedUpon further inspection, it appears that class names for new field groups have been moved to the 'Extra CSS classes' text field under configuration for the field group. However, existing field groups prior to upgrading to the latest dev do not get populated.
Comment #10
nils.destoop CreditAttribution: nils.destoop commentedThere is an update hook for that. If you run it, all the extra classes will be populated for your existing groups.
Comment #11
nils.destoop CreditAttribution: nils.destoop commented