Profile2 Pages does a wonderful thing in providing a way to view a user's profile separate than their user account page. My problem is that there seems to be no way to manage this page from the Panels 3 Page manager.

  1. Each page covers a unique path, and my profile's path is not included in those provided.
  2. If I attempt add a custom page with my profile's path, I am stopped with the error message 'The path is already in use. This system cannot override existing paths.'
  3. If I bypass this message (via hack) and add the custom page anyway, I get a "Page not found" error when viewing the profile pages.

What do we need to do to legitimize the Profile2 Pages url's so that we can work with them in Panels?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Title: Profile2 Pages module introduces profile url that cannot be overridden in Panels Page Manager. » Make Profile2 Pages overriddable in Panels Page Manager.
Category: bug » feature
scottsawyer’s picture

I have Profiles working in Panels for the primary profile that I set up call Main Profile.
Panel - Profile Template (built in Panel)
Selection Rules: URL string: user/*
Relationship: Profile from User (on profile.uid)
When I view a user on user/[uid], I see my panel layout. Perfect.

However, I have 2 other issues.

I have a context for user being viewed. I have place holders for the title: %user:first_name %user:last_name. When I visit the user with their profile ID in the URL (user/1), the replacement pattern works. When I visit the user without the profile ID (user/), I can not see the replacement pattern (like when a logged in user visits their own profile. This maybe something I just need to spend a little more time with.

My real problem is: I have a second profile for my users that I call Company Profile. Using the same panel, I have a variant called Company, selection rule is URL string: profile-company_profile*. This variant never gets selected.

So, I am wonder, should I set up a different Panel Page for the Company Profile? Can the profile be treated as a node? I started messing with a Node Panel and I realized that Profile is not a Node type.

Suggestions? Thanks.

alm’s picture

Thanks for this great module, fago.
I need also to use Profile2 with panels.
For now I'm using a tpl to bypass this and it's working.
Example: I have a profile called candidate, so the template is page--profile_candidate.tpl.php
fago, what is your prediction for this feature be available in panels? Thank you.

RaulMuroc’s picture

Category: feature » bug

Profile2 is 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

Has been solved this issue in updated versions? (Currently: 7.x-1.3). If 'yes', please confirm to close this issue.

spyderpie’s picture

I would like to know to, I am having this issue as well ... Julie

Achille’s picture

Still not solved for me... I did as in comment #2, but no content is displayed from my Profile2 fields.

Does anyone know a solution?

sepgil’s picture

Status: Active » Needs review
FileSize
6.02 KB

Hey I've made ctools task plugin, wish should solve this issue. The following patch provides a page template will be provided, like for the user or node view. All profile types will be overridden, but you can use the profile bundle in the Selection Rules to only override certain profile types.
Please test it out and post some feedback.

Status: Needs review » Needs work

The last submitted patch, 1306146-profil2_pagemanager_support-7.patch, failed testing.

sepgil’s picture

Status: Needs work » Needs review
FileSize
6.01 KB

Uploading new patch, since the last one was faulty.

Status: Needs review » Needs work

The last submitted patch, 1306146-profil2_pagemanager_support-8.patch, failed testing.

sepgil’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1306146-profil2_pagemanager_support-8.patch, failed testing.

sepgil’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1306146-profil2_pagemanager_support-8.patch, failed testing.

sepgil’s picture

Ahhh! WTF? Why won't my patch work on drupal.org? It applys perfectly and I've run the test on simplytest.me, they pass without any problem.
Also the log of the tests are really weird. It seems that the script runs and passes all tests, but at the end it reports that no tests were found...

sepgil’s picture

Status: Needs work » Needs review

I looked into the problems again and it seems like the simpletest bot can't find the tests for whatever reason. Like mentioned before, the test pass on simpletest.me, so I'm setting this issue to 'need review'.

sepgil’s picture

Here is an updated patch, which fixes a fatal error for non overridden profiles.

Status: Needs review » Needs work

The last submitted patch, 1306146-profil2_pagemanager_support-18.patch, failed testing.

sepgil’s picture

Status: Needs work » Needs review
FileSize
6.06 KB

My last patch was little bit empty, so here is the proper one.

Status: Needs review » Needs work

The last submitted patch, 1306146-profil2_pagemanager_support-20.patch, failed testing.

sepgil’s picture

FileSize
85.71 KB

Again, the simpletest failed on drupal.org, but they pass on simpletest.me, so I'm setting this issue to need review.

sepgil’s picture

Status: Needs work » Needs review
sepgil’s picture

Issue summary: View changes

Clarify points.

bojanz’s picture

The patch works, but the exported page is always disabled by default. Haven't yet checked why.

RKopacz’s picture

I have a related issue. Not sure if it applies to this thread or if I should start a new one.

using page manager user profile template enabled.

I used the Main Profile from profile2. I have not enabled the profile2_page module. Added three fields to Main Profile:

Image field
address field (from addressfield module)
link field (from link module)

created a variant using only one relationship (profile from user, as in #2 above).
Did not create a selection rule (Page manager seems to take over the page without it).

I added the three fields from the Main Profile.

The Image field displays, but the address field and the link field do not.

Does anyone know why this is happening? The only thing I can think of is that Image is in core, but addressfield and link are from contrib modules. Do I need to add an additional relationship to get them to appear? they are available to me to add content, so I feel as though I must be missing a relationship or context somewhere.

Please let me know if I should start a new thread. I have looked for a solution but cannot find one online.

P2790’s picture

Hi sepgil,
I apply your patch but don't see a page in pagemanger that I can enable

Spleshka’s picture

Category: Bug report » Feature request
Issue summary: View changes
Status: Needs review » Postponed (maintainer needs more info)

Please tell me what stops you from using Page Manager existing pages module? I guess you are allowed to override any existing page (including profile view page). Or why do you want to provide native implementation for that?

P2790’s picture

@Spleshka
I use PMEP but if I remember correctly I think there were contexts that didn't get pulled through correctly therefore. Although I think things a while a go were not working with panels and page manager which are now fixed through patches to entity and profile2.

I use PMEP to override the profile2 page views and forward them to specific pages.
I then create custom pages using the userid and profileid in the url argument.

mrded’s picture

PMEP module has some problems with contexts. #2271013: Contexts doesn't work with profile2
It may be problem of profile2, not sure yet.

SalmanEagle’s picture

Have you thought about using the simple but effective Display Suite? Here are the steps I used on Drupal 7 to edit the look of a Profile2 user page with fields. For example, to change the text into italic for a field label you would:

1. Download and enable Display Suite (including Display Suite Extras, and Display Suite UI).
2. Go to Structure > Display Suite.
3. Click on "Extras" besides the X that closes Drupal windows.
4. Select "Enable Field Templates", and then choose "Expert" in the dropdown under 'Default Field Template'. Save configuration.
5. Click again on Structure > Display Suite. Select "Manage Display" for 'Main Profile' in the list.
6. To edit the look of a field, click on the gear icon on the right of each field.
7. For my purposes I wanted to make a field's label red coloured and italic. To do this, enter "DIV style=color:red;font-style:italic" (without inverted commas) in the Element area for Label Wrapper after enabling the latter.
8. Hit Update, and MAKE SURE TO also Save.

Thats it.

Salman,
www.saltanatoflove.org

capfive’s picture

p.s awesome module btw!

This is ok if you just want some pretty styling, but you can do that by overriding the tpl.php file anyway, but what i think people want panels for, is to be able to parse selection rules and context through to display, I am using it to display based on the user being viewed's role.

E.G if user is Premium account, show X View, if user if Basic account, show Y view.

I have tried to override with a custom page under http://website.com/custom-profiles/%user it throws up an error saying

"That path is already in use. This system cannot override existing paths."

I need to be able to override this path, so any user profile being used can have a selection rule put on it by user's role being viewed which will in-turn allow me to show different views :)

capfive’s picture

OK i sort of figured this out, the issue lies in when you are using Profile2 Reg path, because it creates a separate page, which can't be overidden, it is used by the module when you set it

i.e
profile2_regpath

but if you disable this, then everything is done via the user profile page and you can override this via Panels and then do whatever your mind desires!

yay drupal!

Leeteq’s picture

Title: Make Profile2 Pages overriddable in Panels Page Manager. » Make Profile2 Pages overriddable in (cTools) Page Manager
Version: 7.x-1.0 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active

If I understand this correctly, this issue is about removing the limitation that forces a choice between Profile2's Unique Registration Path function and integration with cTools' Page Manager.

capfive’s picture

correct, we would like to be able to override the custom path pages so that we aren't forced to throw everything on the standard user page

Status: Active » Needs work

The last submitted patch, 20: 1306146-profil2_pagemanager_support-20.patch, failed testing.

ndf’s picture

This is patch #20 but manually applied on 7.x-1.x branch and the rerolled.

ndf’s picture

Status: Needs work » Needs review

Put this on "needs review" to force testing patch #37 by testbot.

ndf’s picture

Status: Needs review » Active
ndf’s picture

Created a separate module Profile2 Pages that started with patch #20.
It contains page manager implementation for profile2_view and profile2_edit.
profile2_view is working good, but profile2_edit only supports "general form" well.
Hope it can help you too.

atpaust’s picture

Profile2 Pages module looks like a good approach but it does not work for me. I got some errors when configuring my profile_viwe, theose errors were not cleaned up through uninstall process, making it impossible to start over again by uninstalling and then reinstalling the module. I already submitted a bug report about it to the project maintainer on the project issues page.