Use single field for user names #10405
-
Given the wide diversity of name schemes across various cultures, Craft's use of I think I'd prefer — and others have mentioned this, too — that Craft use a single Then, combine this with methods (and event hooks) for accessing a This way, it's up to each dev how to best handle names according to the context, customs, and needs of their project. (I frequently use the name-parsing functions in the Wordsmith plugin to handle this on my projects. For example, if I want to sort by last-names, I could create a read-only/Preparse field to auto-populate with As a convenience, it may be preferable to allow user registration controllers to accept either a single (System email templates that rely on the assumption of a first/last name should probably get updated to use a full name, or a salutation without a name.) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I don’t want to lose the ability to sort users by their last name, so completely dropping the first/last name separation isn’t really an option. Instead I think we should be adding more columns: Then we can update the Edit User page UI to show a single “Full Name” input, which uses parse-full-name to parse and store the individual components in respective hidden inputs for the controller. The UI should also have the ability to show an expanded view with visible inputs for each of the components. (And default to the expanded view if we can predetermine that the library isn’t able to parse a combined full name accurately.) That would give us the best of both worlds: a simple Full Name field, automatic component parsing, storage, and sorting. |
Beta Was this translation helpful? Give feedback.
-
Alright this is resolved for Craft 4 (#10624). Decided against adding all the extra fields, but keeping First/Last Name around viewing/sorting on user indexes. |
Beta Was this translation helpful? Give feedback.
Alright this is resolved for Craft 4 (#10624). Decided against adding all the extra fields, but keeping First/Last Name around viewing/sorting on user indexes.