Community Documentation

HowTo: Create new profile fields

Last updated May 26, 2009. Created by Amazon on May 27, 2005.
Edited by bekasu, Senpai, AjK, cel4145. Log in to edit this page.

  1. Enable the profile module:
  • In administer » modules select in the 'Enable' column where you see:
    profile | Support for configurable user profiles.
  • Create new fields or edit existing ones:
    • Navigate to the administration area: administer » settings » profiles
    • Select a form field type under 'Add new field'
    • Follow onscreen instructions for configuring this field, and 'save field'.

    D6 Info

    In D6, additional profile fields are managed at admin/user/profile ("Administer » User management » Profiles").

    Comments

    Multilanguage?

    Is it Possible to translate the Titles of this additional fields? I can not find the Strings in the Translation section...

    *_*

    Perhaps using the string override module.

    Regards.

    Numeric field?

    There's probably a really obvious answer to this, but how can I make a field that only accepts a numeric value? I want people to be able to enter a dollar amount, but right now I'm stuck with using the "textfield" type, meaning people can enter a value of "Harvey" dollars if they feel like it :/

    ...

    I've the same problem, but I don't think that is possible by default. Anyone got a solution?

    Profile Numeric Field

    I'm looking for a solution to this as well. I haven't found a good answer after a day of looking. :(

    Web Developer, Iowa State University College of Veterinary Medicine

    Content Profile

    You can always use the Content Profile module. You can use a node the profile and use whatever CCK fields you want to (filefield, images, or numerics).

    Z.Monkey

    But...

    I know, but this site is quite a ways along in use at this point and doing a migration from core's profile module to content_profile just so that I can use numeric operators doesn't strike me as the best solution. There has to be a hook that lets me modify the handler. I just haven't been able to find anyone that can tell me what it is.

    Web Developer, Iowa State University College of Veterinary Medicine

    apparently not so obvious...

    i just stumbled on this conundrum to and cannot find a solution... So am commenting just to follow this topic... I needed to sort users in a view based on other criteria than their creation date. I ended up using a drop-down field containing the alphabet and assigned certain users with edit rights to that field... I can get away with that in my situation since there are only a few users, but it would be more user friendly for those with edit rights if it were a numeric field rather than text.

    how to force users to update their profile

    After adding new fields to the core profile, how can I force users to update those new fields? For instance, when they next log in?

    I just added the signup and uc_signup modules, which use the core profile fields for gathering information about the "signee". But none of my existing users will have these new values entered unless I can force them to before they signup.

    I also need to know that too,

    I also need to know that too, especially if its a required field I want to use to do some other operation.

    "I would rule the world - If only I had the source code"
    R.A.Smith -- "ƒrÅzRâ§"
    http://www.exterbox.com

    Please answer this

    I am also trying to know how to do this. I have been searching around. Can someone please answer this?

    - Mario (Veterinarians)

    I Also Need to Force an Update of Profile Fields

    Is there an option somewhere in the Content Profile module that would force current users to update their profile?

    Its funny how so many obvious features are left out when programmers create these modules. I am a drupal addict but don't have the programming skills so I depend on features from modules.

    Kaleem S. Clarkson
    www.kaleemclarkson.com

    I understand adding a field

    I understand adding a field tot the user profile is more logic than creating a new content type by means of the content profile module (as long as the type of fields allowed in user profiles is sufficient).

    However: I would like the e-mail adress from the user profile to be shown on the user node, for all users. How to force this?

    how to add checkbox field with compulsary ?

    how to add checkbox field with compulsary ?

    i have added
    - Title: "I agree to the Terms and Conditions"
    - type : checkbox
    - Form name: profile_conditions
    - The user must enter a value.

    on user registartion. but i am not able to make it's validation on page. can u tell me any budy problem with this?

    thanks
    Prakash

    Prakash

    Use CCK and content profile modules

    define your fields and then edit that content type to make the fields available on registration form.

    thats it....

    www.drupal4u.in

    Legal module

    that sounds like a job for the legal module http://drupal.org/project/legal

    "I would rule the world - If only I had the source code"
    R.A.Smith -- "ƒrÅzRâ§"
    http://www.exterbox.com

    Can't add new fields

    I had added a few fields to the profile module which I deleted after deciding that they would function better as a freeform list, rather than a single-line text field. When I went to add the fields in again with the new format, They aren't added to the list of fields.

    Even when I tried adding them as simple text fields again, or with different field names, they don't get added. I can't seem to add any new fields to the Profile form now.

    Any suggestions?

    Roger Goode | Artist/Designer | Hillsborough, NH

    Are you using "Profile Pictures?"

    I installed the Profile Pictures module before I started trying to add fields. When it came time to start adding fields I found I couldn't. Each time I'd hit 'save' it would just clear the fields and place me back at the top of the page. Wilkenw (below) said he had issues with multiple picture uploads so I tried disabling the Profile Pictures module and, sure enough, I was able to add fields as necessary.

    I'm still looking for the rest of the story on the PP module.

    Adam Clear

    ThePixelMines.net

    User unable to add profile fields ...

    After adding numerous user profile fields, I, too, found myself unable to add more, except by using SQL update commands. After disabling the supplementary module which allows adding muliple photo fields to user profiles, the problem disappeared.

    Posting identical title fields

    I am trying to add fields with identical names. How do i add titles that are the same withought getting a "The specified title is already in use." error?

    looking fo a hack.

    Token for a profile_field

    How do I create a token for new profile fields as created with the above documentation?
    Thanks!

    edit: found it. It's a nice module named Token Profile. ;-)

    Wakken!

    How can I choose these fields

    How can I choose these fields to be in the registration form of new user ?

    Oh! there is a
    "show on registration form"
    option I hadn't see...

    How could I re-arrange the

    How could I re-arrange the profile fields to the beginning of add new user form ?
    Right now all profile fields will show on the bottom of the add new user form.

    Check to see if a profile field exists

    So I have a module that automatically updates user profiles from a LDAP pull and puts the info into a profile field. I found out that my method for creating the fields is flawed. I was using:
    if (!array_key_exists($userfield[$i], $user)){
    to check to see if the profile field existed and then create the field if it did not. If the field exists, but not for a user (first time they logged in) an error is generated.
    How can I access a "profile field" array to check to see if a field exists (what you see on admin/user/profile).

    Figured it out

    $sql = 'SELECT name FROM {profile_fields}';
    $results = db_query($sql); // Run the query
    $profilefields=array();
    while ($fields = db_fetch_array($results)) { // Get the next result as an associative array
      foreach($fields as $key => $value) { // Iterate over all of the fields in this row
       $profilefields[$fields[name]]=$fields[name];//pass values into 1 array
      }
    }

    Then I can user $profilefields instead of $user
    if (!array_key_exists($userfield[$i], $profilefields)){
    FYI $userfield[$i] is the field name I need.

    How to Set Default Value for Select List?

    I have a select list in my user profile. I don't see a way to set a default value. When filling out a profile, a user would see two dashes ("--") apparently set as the default value before the user makes her/his choice. I'm using views to filter a view depending on this select list. In views, only the values I set for the select list are given as choices for the filter. There is no "--" choice. Any pointers? Thanks.