My question is - how to add custom field component to the fields list?
For example, I would like to use SS-color-picker (https://github.com/dimension27/silverstripe-color-picker) with UserForms.
Thank you :)
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
My question is - how to add custom field component to the fields list?
For example, I would like to use SS-color-picker (https://github.com/dimension27/silverstripe-color-picker) with UserForms.
Thank you :)
UserForms automatically picks up any subclasses of EditableFormField so you can create userforms compatible versions of form fields as you wish. For an example see https://github.com/wilr/silverstripe-googlemapselectionfield (or more specifically - https://github.com/wilr/silverstripe-googlemapselectionfield/blob/master/code/EditableGoogleMapSelectableField.php)
Hmmm, I've checked on fresh new installation of SS3.0.3 and three modules (userforms, colorpicker and googlemapselectionfield).
Yes, Google map in the list, but not colorpicker :(
Logically - I have problems with colorpicker... OK, I'll try to find it.
As I said, you'll need to create an EditableFormField class. This will act as a wrapper around the Color picker field. You may wish to email the author of ColorPicker to add that class for you.
Thank you for quick help :)
I've done it by myself. Now it works :)