User profile fields
Template:Moodle 1.8Location: Administration > Users > Accounts > User profile fields
In Moodle 1.8 onwards, administrators are able to create new user profile categories and fields. Profile fields may be a menu of choices, text area, text input or a checkbox (in Moodle 1.9.3 onwards) and may be required or not.
New profile fields will appear on each user’s profile page unless "Who is this field visible to?" is set to "Not visible" in which case only the administrator can see the field. From Moodle 1.9 the fields can also be displayed on the signup page if "Display on signup page?" is set to "Yes" (although note that they will never be displayed if set to "Not visible").
Important
If the site administrator bulk uploads user data via .csv file, it is essential to use the correct convention to represent the new profile field. The convention is profile_field_shortname
Replace 'shortname' with the actual short name used for the new profile field eg. dob. So the field should read something like profile_field_dob.
Also, you will need to visit Site Administration > Users > Accounts > User Profile Fields > Create new Profile Field before attempting to upload a file using it. Creating an upload file first with custom profile fields without creating the User Profile Fields first in Site Administration will result in the error profile_field_shortname is not a valid field name.
Furthermore, keep in mind that the shortname must be all lower case to avoid errors when uploading users via a .csv file. This currently is not enforced when creating the shortname. See MDL-17344 for more information.
Examples of use
- House System
Many schools have a 'House' system where students and staff are assigned to a given House. For example, a school has eight houses, named after its founders: Adderton, Coolock, Gorry, Loretto, McAuley, Mercedes, Tighe and Whitty. The site administrator can add a user profile field that offers a 'Menu of choices' to the user. A default value can also be selected. If the administrator decides to bulk upload House data for users via a .csv file, it is important to represent the above array of values as 1,2,3,4,5,6,7,8 in the file. That is to state, if a user belongs to Adderton House, the value '1' should be entered for the 'House' user profile field in the given record.
- U.S. States
This can be used to improve ambiguous postal addresses by including (for example) the State.
- Birthday block (contributed code)
See also
- Using Moodle How can I show ID Number in the user profile form? forum discussion