User profile

However, what we have done so far will not give us a user profile page that is comprehensive enough. To get what we want, we need to enable the Profile module on the modules page. On visiting the Profiles link in the admin menu, we will be presented with a page like the following:

Profiles

This page displays a list of the existing custom profile fields to be displayed on a user's My Account page, To provide structure, similar or related fields may be placed inside a category. To add a new category (or edit an existing one), edit a profile field and provide a new category name. To change the category of a field or the order of fields within a category j grab a drag-and-drop handle under the Title column and drag the field to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.

Title Name Type Operations

No fields available.

Add new field single-line textfield multi-line textfield checkbox list selection freeform list URL date

This page presents us with seven possibilities for creating new fields on the User account page. Now let us add form fields for the following information:

• Alternate email address

Name

The Name field is a single-line textfield. This is the link on the Profiles page that we will click on to create this field. This gives us a page where we will fill in the following details:

• In the Category field, let us enter Personal information, because that is exactly what this is all about.

Title Name Type Operations

No fields available.

• For the Form name, enter profile_name.

• For Visibility, select Public field, content shown on profile page but not used on member list pages.

• For the Page title, enter People whose name is %value. This will enable site users to find people whose name contains a certain string defined by the user (for example, Tom, Tomas).

• Select the last three checkboxes to make this field compulsory, auto-completed, and visible when users are newly registering.

The completed page is shown in the following screenshot:

add new single-line textfield

Field settings

Category: *

¡Personal information

The category the new field should be part of. Categories are used to group fields logically, ftn example category is "Personal information".

The title of the new field. The title will be shown to the user, An example title is "Fauorite color",

|profile_name |

The name of the field. The form name is not shown to the user but used Internally in the HTML code and URLs. Unless you know what you are doing, it Is highly recommended that you prefix the form name with prof iie_ to avoid name clashes with other fields, Spaces or any other special characters except dash ("D and underscore (_) are not allowed. An example name is "profile_favorite_colar" or perhaps just "profile_color".

Enter your name

An optional explanation to go with the new field. The explanation will be shown to the user. Visibility:

o Hidden profile field, only accessible by administrators, modules and themes, O Private field, content only available to privileged users, ® Public field, content shown on profile page but not used on member list pages. O Public field, content shown on profile page and on member list pages.

Page title:

¡People whose name is %value |

To enable browsing this field by value, enter a title for the resulting page, The word fvain« will be substituted with the corresponding ualue, An example page title is "People whose favorite color is %value", This is only applicable for a public field.

Weight:

The weights define the order in which the form fields are shown. Lighter fields "float up" towards the top of the category.

0 Form will auto-complete while user is typing,

For security, auto-complete will be disabled if the user does not haue access to user profiles,

0 The user must enter a value. 0 Visible in user registration form.

The Alternate email address and Mobile Phone fields are created by using a similar method.

Date of Birth

The Date of Birth field is a date field, so that is the link that we will click on to create this field.

• In the Category field, let us enter Personal information because that is exactly what this is all about

• For the Title, enter Date of Birth

• For the Form name, enter profile_dob

• For Visibility,select Public field, content shown on profile page but not used on member list pages

• For the Page title, enter People whose birthday is %value

• Select the last three checkboxes to make this field compulsory, auto-completed, and visible when users are newly registering

Gender

The Gender field is a list selection, because each blogger is either male, or female.

Okay, we'll add the I don't know category for political correctness.

• In the Category field, let us enter Personal information because that is exactly what this is all about

• For the Title, enter Gender

• For the Form name, enter profile_gender

• For Selection options, enter Male, Female, and I don't know, on separate lines

• For Visibility, select Public field, content shown on profile page but not used on member list page

• For the Page title, enter People whose gender is %value

• Select all of the last three checkboxes to make this field compulsory, auto-completed and visible when users are newly registering

The following screenshot shows how our new profile creation page looks:

Profiles j Profile fields have been updated.

This page displays a list of the existing custom profile fields to be displayed on a user's My Account page, To provide structure, similar or related fields may be placed inside a category. To add a new category (or edit an existing one), edit a profile field and provide a new category name, To change the category of a field or the order of fields within a category, grab a drag-and-drop handle under the Title column and drag the field to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon,) Remember that your changes will not be saved until you click the Saw configuration button at the bottom of the page.

Title Name Type Operations

Personal information

«$* Name

profile_

textfield

edit

delete

«$* Mobile Phone

profile_mobile

textfield

edit

delete

♦$* Alternate email address

profile_email

textfield

edit

delete

Date of Birth

profile_date

date

edit

delete

«î» Gender

profile_gender

selection

edit

delete

[ Save configuration J

Save the configuration. Note that we have chosen to have all of these fields show on the user registration page. In order to make sure that it works the way we planned, let's log out from our admin account for a minute and attempt to register as a new user, by clicking on the Create new account link. The form that will be presented to us will be similar to the one shown in following screenshot:

User account Log in Request new password

Account information Username: *

Spaces are allowed.! punctuation is not allowed except for periods, hyphens, and underscores, E-mail address: *

A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.

Personal information Name: *

Mobile Phone: * Alternate email address:

Your alternative email address for contact

Date of Birth:

Your birthday

[ Create new account ]

So our profile page has been properly configured (the way we want it), and you can finally see what happens when Hubert completes his profile.

hubert Edit

File browser

Personal information

Hubert Loos

X

Mobile Phone 077B69047D8

Date of Birth 03/24/1950

Gender I don't know

History

Member for 14 weeks 4 days

View recent blog entries

0 0

Post a comment