Khanh Hoang - Kenn
Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.
Drupal 7 has made it easy for you to allow your site users to share information about themselves. User accounts are now "entities" which means that you can add fields to them, just as with content.
You can add user profile fields for names, email addresses, phone numbers, resumes or whatever else you might need.
However, there are some limitations to the core user profile. What happens if you don't want user accounts visible to the public? What happens if you need different profiles for different areas of your site?
The answer is the Profile2 module.
Profile2 is only available for Drupal 7 sites.
For those of you with experience building sites in Drupal 6, let me explain why it's not needed for Drupal 6. In Drupal 6 you have the core Profile module. However, that did not make it into Drupal 7.
The Content Profile module was also a good option for Drupal 6 sites.
In Drupal 7, the Profile2 module creates a profile entity similar to how a node is an entity, a user is an entity, a vocabulary term is an entity. Because profile is an entity, we can add fields to it and we can have more than one.
To understand what Profile2 does, let's take a look.
By default, Profile2 provides one profile type. You can see an example below. The screenshot shows that we have added three fields to the main profile: image, name, and bio.
There are two modules required for Profile2 to work.
Install the modules to your site and you will be able to see them in your module list.
As you can see from the screenshot below, there are just a few options to consider for each profile type.
The first checkbox will give the users access to their profiles if they edit their user accounts.
The second option will add links to the profiles to the User menu so that your users can edit them. Here's how the profile links might appear:
From inside the Structure > Profile 2 area you can add field to each profile type.
In addition to the settings discussed above, below are few others to consider.
If you are having a hard time envisioning how Profile2 can be used on your site, consider the following use case (borrowed from http://drupal.org/node/1114454 .)
"One profile stores contact information (address, city, etc) and this information through the permissions is able to be edited by the user. The second profile is information that is related to a user's membership, so things like membership ID, year joined, etc. This information is such that it can be viewed by the user, but not edited."
Bình luận (0)
Add Comment