Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

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.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

UserForms - how to customize fields list


Go to End


5 Posts   1085 Views

Avatar
dymale

Community Member, 4 Posts

12 February 2013 at 2:35pm

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 :)

Avatar
Willr

Forum Moderator, 5523 Posts

12 February 2013 at 5:38pm

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)

Avatar
dymale

Community Member, 4 Posts

13 February 2013 at 8:47am

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.

Avatar
Willr

Forum Moderator, 5523 Posts

13 February 2013 at 9:44am

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.

Avatar
dymale

Community Member, 4 Posts

13 February 2013 at 12:03pm

Thank you for quick help :)
I've done it by myself. Now it works :)