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.
Currently the module implements a select list which only allows you to select a single class. We should allow users to select multiple classes via a checkbox list or multi select list.
Comment | File | Size | Author |
---|---|---|---|
#7 | classy_paragraphs-select_multiple_classes-2424795-7.patch | 11.49 KB | dabbor |
#5 | classy_paragraphs-select_multiple_classes-2424795-5.patch | 1.81 KB | dabbor |
Comments
Comment #1
dabbor CreditAttribution: dabbor commentedAttaching patch that allowes multiple CSS classes to be applied entities by modified the logic to add all classes to the paragraph item.
The field cardinality must be set unlimited in order to make the multiple classes to work (to get multi select list widget).
Comment #2
dabbor CreditAttribution: dabbor commentedComment #4
dabbor CreditAttribution: dabbor commentedFixed patch to have relative diff paths.
Comment #5
dabbor CreditAttribution: dabbor commentedFixed patch comment number :D
Comment #6
Ivan Zugec CreditAttribution: Ivan Zugec commentedLeave this return in.
Change to "Get class names from paragraph item."
- Currently the only widget available on the CP field is "Select list", we should also allow the checklist widget.
- It'll be good to write a test for the multi classes.
Comment #7
dabbor CreditAttribution: dabbor commentedAttaching modified patch.
Changes:
Wrote a test for the multi classes (modified classy_paragraphs_test feature too) + refactored classy_paragraphs.test a little bit.
Comment #8
dabbor CreditAttribution: dabbor commentedComment #9
Ivan Zugec CreditAttribution: Ivan Zugec commentedGood work.
Comment #10
Ivan Zugec CreditAttribution: Ivan Zugec commentedComment #12
Ivan Zugec CreditAttribution: Ivan Zugec commentedCode committed.
Thanks.
Comment #14
groovedork CreditAttribution: groovedork commentedI haven't played with this hands-on yet, so take this with a lot fo salt, but I am wondering: is heaping classes on top of each other a good idea from a usability standpoint? Front-end developers understand how different CSS stylings can work together, but a layman probably doesn't. Adding just a single 'visual accent' to a paragraph might be easier to conceptualize.