Drupal Site Article Writing
Creating an Article for your Drupal Site
Changing Colors in Your Drupal Theme

Enhancing Drupal User Profiles

One way to improve the sense of community on your Drupal website is to allow visitors to add details about themselves to their profile pages. Drupal 6 used the Profile module, but Drupal 7 has removed it and added this functionality to the Account Settings page (found by choosing Configuration→People→Account Settings). A custom user profile form that users can fill out is shown.

image0.jpg

The information a user enters on this form will show up when anyone clicks the username for that user.

To create a form that your users can fill out and add more information to their profile pages, follow these steps:

  1. Choose Configuration→People→Account Settings.

  2. Click the Manage Fields tab.

    You have to create all the form fields that your users will answer using the Add New Field section of the form, as shown.

    image1.jpg
  3. In the Label text box, enter the question you want the user to answer.

    This should tell the user what kind of information you want him to enter in this text box — for example, What kind of site are you building with Drupal?

  4. In the Name text box, add a distinctive name with underscores instead of spaces.

    Drupal uses the name to keep track of this text box, but it will never be seen by you or the users filling out the form. The example shows where an addition to the word field that was already in the text box and ends up with field_about_your_site.

  5. From the Field drop-down list, select a field type.

    In this example, choosing Text makes the most sense.

  6. From the Widget drop-down list, choose the type of form element that makes sense.

    Text makes the most sense in this example. You can also use the widget to create a multiple-choice drop-down list by choosing Select List.

  7. Click Save.

    Now, when users sign up or click the My Account link, they’ll see the Personal Information tab. Clicking that tab displays any form fields you created under the Personal Information category.

To create a drop-down list, follow these steps:

  1. Choose Configuration→People→Account Settings.

  2. Click the Manage Fields tab.

  3. In the Label text box, enter the question you want the user to answer.

    This time, make it a multiple-choice question such as, How much experience with Drupal do you have?

  4. In the Name text box, add a distinctive name with underscores instead of spaces.

    An example is profile_experience.

  5. From the Field drop-down list, select a field type.

    This time, choose List (Text); it makes the most sense.

  6. From the Widget drop-down list, find List (Text) and choose Select List.

    You’re prompted to enter drop-down list options.

  7. Click Save.

    The Field Settings form appears.

  8. Enter the possible answers to the question, one per line.

    For example, to answer "How much experience with Drupal do you have?", you might enter options such as these:

    • None

    • Less than 6 months

    • About a year

    • More than a year

    The result looks like:

    image2.jpg
  9. Click Save Field Settings.

Now, when a user browses to her My Account page, she will see an Edit link that takes her to the form with the fields you just created.

blog comments powered by Disqus
Basic Page Editing in Drupal
Drupal Basic Page Deletion
Drupal Site Home Page Ordering
Activity Stream Drupal Module
Drupal Gardens Pages and Block
Advertisement

Inside Dummies.com