Hi,
i'm stuck on this problem and can't find a good solution...
I have 3 profiles types (main profile, member profile and staff profile).
I would like to show for example on a staff user's page, the main profile and the staff profile fields of this user, using the layout i built in Panels.
In the user's page override in Panels pages, i can't add profile fields of this user, and when i try to add a profile context, i'm asked to set a specific profile id. This way, i'm able to put profile2 fields in panels, but as my context is bound to a specific profile id, all the users' pages are showing the same profile...
I'm sure there's a way to tell context to adapt the profile ids to the user, and i actually see tokens like %user:my_profile_type, but don't know what to do with them...

I'm not sure i'm clear enough, but my main question is : how can i show user's profile fields in a panel ?

Thanks in advance,
Ben

Comments

merlinofchaos’s picture

Status: Active » Fixed

You mention profile2, but I don't know anything about profile2. If you need fields from profile2, the module may need some help.

We recently got some entity field support, though, so if profile2 is using field api, they should now show up automatically.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

raulmuroc’s picture

Title: Display user's profile fields on the user page with Panels » Display user's profile2 fields on the user page with Panels
Component: User interface » Page Manager
Category: task » bug
Status: Closed (fixed) » Active

Profile2 is still not working correctly due to Ctools Page Manager.

On the one hand, When I activate Ctools Page Manager, then the profile2 fields in Panels doesn't refresh their content when I change them.

On the other hand, when I deactivate Ctools Page Manager, then the profile2 fields in Panels does refresh their content though the panel page structure gets broken.

raulmuroc’s picture

Priority: Normal » Major
scottsawyer’s picture

Hello RaulMuroc,

I assume your comment on http://drupal.org/node/1100956#comment-5668628 is in regards to the same situation?

I am getting some progress here, not sure if my situation matches your's, but it seems like it might.

Let me recap the situation and see if it follows.
Let's say you have 2 roles, Staff and Members. Each role has a separate Profile2 profile. Maybe you want to create a panel page "Staff", example.com/staff. Great, let's call that variant_1
Now you want to create a variant for each staff user which might include Profile2 fields for that user, call it variant_2. Let's say our user's user name is RaulMuroc.

I set up my panels with a URL pattern staff/%staff

For variant_1, my selection rule is URL != staff/*

For variant_2, selection rule is URL == staff/*

For variant_1, I set a title "Our Fantastic Staff", that works fine.

For variant_2

  • set a Context of Profile
    • in the settings, the title of the profile we are using is "Staff"
    • identifier: "Profile"
    • keyword: "profile2".
  • set a Relationship of Profile from User (on profile.uid)
    • In the settings: User: User Name
    • Identifier: Profile from User (on profile.uid)
    • Keyword: user_2
  • Set a title of %staff:name. go to the URL example.com/staff/RaulMuroc, that should show as the title.

If everything is working so far, we should be well on our way. In my case, I am using a profile2 field as the page title, so my title looks like %profile_2:field_awesomeness. So when I visit example.com/staff/RaulMuroc the title of the page is whatever you decide is your awesomeness.

Now I am ready to add panels content. When I go to the add content screen, on the left column, I have all the usual stuff, plus Profile2, Profile2 (tokens), User, User (tokens).

Clicking Profile2, I see all my fields. If I select my field, I see that my context is already selected (only using one context at the moment).

Add your content, save, visit example.com/staff/RaulMuroc and make sure things appear as expected. You should be in business, works for me.

As an additional note, I wanted to add a view for some content that RaulMuroc created. I have a view with a contextual filter for the Author:UID, and a relationship of Content:Author. Now when I add the view to the panel, I set my context to User - UID. Now I am passing the correct user ID to the view. Happy Day!

raulmuroc’s picture

Status: Active » Fixed

I worked on your solution and it is fine, it worked for me!

So thanks, I think yes i missconfigured and that's why it didn't work correctly.

Lot of thx.

Status: Fixed » Closed (fixed)
Issue tags: -Profile2 Panels Context

Automatically closed -- issue fixed for 2 weeks with no activity.