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.
With the hook recently introduced we are able to use specialised trigger value widgets.
Currently there are only simple textfields as defaults and for some fields select lists available.
But if we would add some keys in the hook, we could provide the possibility to use a custom trigger value widget for each field widget.
To achieve this, we have to add the following keys:
- trigger_value_widget: A callback used to create the trigger value widget
- trigger_value_widget_multiple: A boolean indicating whether the trigger value widget is able to handle multiple values at once (e.g. select lists are able to, but textfields aren't)
- trigger_value_widget_submit: Basically creates a string out of the value of the widget created by trigger_value_widget, that can be written to the database
- trigger_value_decode: Decodes the trigger value in the database to a string or array of strings that can be used in a #states array
Comment | File | Size | Author |
---|---|---|---|
#4 | trigger_value_widget-2341789-4.patch | 14.15 KB | Tobias Xy |
Comments
Comment #1
Tobias Xy CreditAttribution: Tobias Xy commentedComment #2
Tobias Xy CreditAttribution: Tobias Xy commentedI will do that together with #2276393: Rewrite of admin UI.
Comment #3
Tobias Xy CreditAttribution: Tobias Xy commentedBecause I can't release 2.1 until this one here is done, I will do it separately again. :D
Comment #4
Tobias Xy CreditAttribution: Tobias Xy commentedPatch.
Comment #6
Tobias Xy CreditAttribution: Tobias Xy commentedCommitted.