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.

All other Modules

Discuss all other Modules here.

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

UserForms - how to customize fields list


Reply

5 Posts   339 Views

Avatar
dymale

12 February 2013 at 2:35pm Community Member, 4 Posts

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

12 February 2013 at 5:38pm Forum Moderator, 5511 Posts

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

13 February 2013 at 8:47am Community Member, 4 Posts

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

13 February 2013 at 9:44am Forum Moderator, 5511 Posts

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

13 February 2013 at 12:03pm Community Member, 4 Posts

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