Hi there,
I'm using the profile.module to generate a more detailed user registration form, and it works pretty well. However, I would like to be able to set field types and attributes. For example, I'm using a single line entry field to allow the user to input their phone number. I would like to be able to set the field type for that particular entry field to be "numeric". Other suggestions would be letters only, or numbers in a specific range, or even to be able to set your own regex. I'd also like to be able to limit the number of characters entered in the text fields.
I'd also like to be able to use radio buttons but don't see how I can do that. I can work around this for the moment by using a list selection. The only other thing I think might be missing is the ability to add a list selection where you can select multiple items.
Cheers,
Stella
Comment | File | Size | Author |
---|---|---|---|
#4 | drupal_profile.2.patch | 24.09 KB | Alan D. |
Comments
Comment #1
killes@www.drop.org CreditAttribution: killes@www.drop.org commentednew features go into devel version.
Comment #2
lilou CreditAttribution: lilou commentedThis feature request is it still valid ?
Comment #3
Alan D. CreditAttribution: Alan D. commentedAs a fallback if Migrate profile module data to field API doesn't get in. Guessing this is too late to get reviewed though.
This is a minimalist approach to extending the profile module without hooking into fields. It is a port of a Drupal 6 profile hack.
It uses the current profile field types and one new taxonomy field. The taxonomy field is saved as a serialized value, so no new db tables are required.
It moves profile field definitions to a simple
hook_profile_fields()
.Each defined profile field can have three configurable callbacks:
Two load / save callbacks can be specified. These are run through the data on load / before saving, enabling better data handling if required. For the date and taxonomy fields, this is simply unserialize and serialize calls for date and taxonomy.
For example, the taxonomy field is defined as:
Comment #4
Alan D. CreditAttribution: Alan D. commentedThe preview killed the attachment ;\
Comment #5
Alan D. CreditAttribution: Alan D. commentedMaybe Drupal 8 with fields. See #394720: Migrate profile module data to field API