Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Getting Started with Profile2
- Creating and Managing Profile Types - To get started with profile2 you will need to create a new profile type or manage the default one. This can be found at admin/structure/profiles
- Creating and Editing your Profile - By default profiles can be created and edited at user/uid/edit. There should be a secondary tab for each profile the user has access to.
- Private Fields - Private fields are only visible to the profile owner and administrators. Field privacy is managed through the check box at the bottom of field edit page (i.e. /admin/structure/profiles/manage/profile/fields/myfield).
- Profile Permissions - In order to make profiles creatable and visible to users you will have to manage the permissions for each profile type (located at /admin/people/permissions#module-profile2).
Profile Pages
The profile pages module (included with profile2) allows for profiles to be managed outside of the normal user edit page. Instead of a tab on the user edit page, the profile view and edit pages will be located at /profile-profile_machine_name/[user id].
Link to profile page with views
- Add FIELDS "user uid" (The owner of the profile).Then check option "Exclude from display" in the field configuration window. Remember to put this field before any other field in FIELDS render, so that this token could be available for followed fields.
- Add another FIELD, e.g. "nickname" and make each user "nickname" linked to associated user profile. When configure this field "nickname", click REWRITE RESULTS and check option "Output this field as a link". Click REPLACEMENT PATTERNS to ensure token [user] is available for this field "nickname". Write profile-profile_machine_name/[user] (e.g. profile-main/[user]) for Link path.
- Save all configurations. The Field "nickname" in views will be linked to each user profile page.
For views integration with multiple profile2 types
When creating views with multiple profile types, you must create a relationship for each profile type. One relationship mapped to more than one profile type will result in duplicates in your view.
- Create Profile2 types;
- Create fields for Profile2 types;
- Create users and add Profile2 data;
- Create View (Show:User);
- Add relationship, (User:Profile) and give the identifier a unique name e.g. 'MainProfile'; IMPORTANT: select a single checkbox for one 'Profile type', e.g. 'Main profile';
- Add another relationship, (User:Profile) and give the identifier a unique name e.g. 'EducationProfile' and select the appropriate checkbox for 'Profile type', in my case 'Education profile';
- Add fields to view and select Profile2 field items. Use Relationship dropdown in 'Configure field' to associate w/ correct relationship;
The above comes from comments#71 & #72 at http://drupal.org/node/1114454.
Comments
Thanks for the views instructions!!!
Good call for adding instructions on how to use Profile with views! It makes it much easier to understand how best to use this module.
Thanks!
Caryl
I have added some extra
I have added some extra fields but I cant find them to add in views. What am I missing here?
add a relationship to the
add a relationship to the view to pull in fields from related entities
freedom isn't free
Profile2
I have to different roles. "musiker" and "bonus-musiker" with profile2.
My problem is the paths
www.aaa.com/profile-musiker/nid
and
www.aaa.com/profile-bonus-musiker/nid
I would like to have: name instead of nid??
I can not change paths with URL aliases patterns. i would like to have all similar like /...../profile-name/artistname
Any ideas please?
exported templates I can import into my site?
HI,,are there any exported templates I can import into my site,,,to cut down on so much typing and waiting....
Lazy Admin
Link path doesn't work...
Hi Sir,
I was following the above instructions for integrating views, but for some reason, the link still outputs user/[user:name] instead of profile-main/[uid].
I am using 7.12.
I don't know where to upload image so I'll just put the link
configure
Users View
Sorry for the bad quality of image but if you zoom in on the first image the link path is set to profile-main/[uid], but after saving and saving again, the view on the users side is still users/[user:name]...
hope to hear from you soon.
Yep I found the solution
I see, the "link to user profile" should be unchecked. if you are using profile2
I got an error "page not
I got an error "page not found" when creat a view to replace profile-profile_machine_name/[uid] to profile-profile_machine_name/[user]. Please help me correct it.
Link to profile page with views
This doesn't make sense to me. None of the fields that I make for the "Profile Types" that I create are exposed in views. Even the User ID seems to be missing. As such, these instructions don't make sense... Any help would be appreciated.
Profile view or Profile Type view?
It sounds to me like you're trying to create a view for user's profiles when instead you selected "Profile Type" when you starting the view (which would relate to showing a view of the different types of profiles you have on your site). Try it with "Profile" instead.
Thanks, I eventually got it
Thanks, I eventually got it figured out. I'm new to Drupal 7 as well, so I didn't understand that I had to add the "Profile" relationship in my view before the profile fields would be exposed. It's all good now :).
I've since figured out why the profile module is useful as well. From what I understand, you can't add new fields to the "user" profile page out-of-the-box. So I've instead created fields using the Profile2 module, and used those fields to customize the User pages using Panels. It still makes more sense to use the User profiles instead of the content-types generated through the Profile2 module since I can't use Pathauto with the Profile2 module. It seems to me that Profile2 is meant to be used in conjunction with the default User module.
I don't understand the
I don't understand the purpose of creating a profile view when you have the main user profile page to begin with...Unless you would only be using views with this for certain things.
I've finally been able to get
I've finally been able to get a handle on Profile2 and Profile Pages (or so I thought), and have set up a view per the instructions. The problem is that my link to profile-main/[uid], which reveals itself correctly on roll-over, always reverts back to user/[uid] on click. So I always end up at the user account view instead of the profile view. Any ideas on what I'm forgetting here? Thanks......
Accessing the fields programatically
How can I access these Profile 2 fields programatically? I am trying to save a new user, and in that save I want to save their other profile values. See code here:
But I know that the way I'm trying to save fname and lname right now doesn't work. Please help.
Somewhat fixed
I added this code after what I have above to make the user profile fields save. Can I make this shorter?
profile2_load_by_user might be useful
This is what I used to fetch the profile field values
Were you looking for this?
- Mittal Patel
http://www.MittalPatel.co.in
http://www.TriCoreITSolutions.com
Profile2: How to assign profile type programmatically?
I have done the below steps (works well! used hook_alter_form to hide the non-appropriate profile type: http://drupal.stackexchange.com/questions/5661/change-the-e-mail-value-d...)
However, I need to now override the default user registration form *processing* and
programmatically assign the profile type depending whether the user has signed up using the vendor or the customer url.
Any help much appreciated,
gvanto
------------------------------------------------------------------------------------------------------------------
I have set up 2 profile types:
- Vendor
- Customer
I would like to create a vendor-specific user registration at
mysite.com/register-vendor
(And for customer, to sign up at /register-customer )
The two diff registration forms should have different input data.
I've checked the "Show on user registration" for each of the two types of profiles (during creation).
On the registration form, a form is shown for both profile types Vendor and Customer ...
Not sure it's best way to do it but I guess I could try and hide the Customer fields during Vendor signup (if the current url == /register-vendor ) but not quite sure how to hide fields on registration based on URL? (Or even if there exists a more elegant solution such as a option in admin I've not considered?)
Any help much appreciated,
Regards,
gvanto
Any help
Solution found to Profile2 registration paths
found this, fantastic: http://grasmash.com/article/managing-account-registration-multiple-user-...
Thanks for a brilliant module: Profile2 !
Gvanto
Profile View Not working when Consumer Logged in
I've created 2 profile types: Vendor and Consumer:
While Vendor profile view works at: /profile-vendor/8
(= profile-[machine-name-profile/[user_id] )
The same does not work for profile-consumer :-(
http://bit.ly/JObb9j
(login: consumer1 / joker45 )
Page not found error on profile view (only 1, the other is OK)
I've created 2 profile types: Vendor and Consumer:
While Vendor profile view works at: /profile-vendor/8
(= profile-[machine-name-profile/[user_id] )
The same does not work for profile-consumer :-(
http://bit.ly/JObb9j
It says page not found ... I've checked this user's uid=7
found issue (had machine name
found issue (had machine name still on old value - it didn't change automatically when I updated the Profile name!)
Users able to edit or add multiple profile types
Not sure what I am doing wrong here, but so far I have everything working great using Profile 2 module, but now when I login to 1 test profile I am able to add/edit another type. I have 2 profiles - Nonprofits and Consultants. When I login to the nonprofit profile I get My Consultant as an option to add to that profile. What did I miss?
Check user permissions
Are you sure you have given the right permissions to add/edit profiles for both the Roles of the users?
- Mittal Patel
http://www.MittalPatel.co.in
http://www.TriCoreITSolutions.com
Taxonomy terms in Profile2 profiles
As I understood, there is a possibility to use links to taxonomy terms in Profile2 profiles. Yes, I can add a field that links profile to taxonomy term, I can display it in user's profile but that's all! It doesn't work as a taxonomy - I mean no users are being shown when I click it. Am I doing something wrong or Profile2 really doesn't work with taxonomy (the same problem as whith native Drupal user profiles)?