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.
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.
- Each page covers a unique path, and my profile's path is not included in those provided.
- 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.'
- 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?
Comment | File | Size | Author |
---|---|---|---|
#40 | Screen Shot 2015-03-02 at 16.54.31.png | 133.75 KB | ndf |
#37 | profile2-pagemanager_support-1306146-37.patch | 5.97 KB | ndf |
#22 | profile2_test.png | 85.71 KB | sepgil |
#20 | 1306146-profil2_pagemanager_support-20.patch | 6.06 KB | sepgil |
#18 | 1306146-profil2_pagemanager_support-18.patch | 0 bytes | sepgil |
Comments
Comment #1
fagoComment #2
scottsawyerI 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.
Comment #3
alm CreditAttribution: alm commentedThanks 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.
Comment #4
RaulMuroc CreditAttribution: RaulMuroc commentedProfile2 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.
Comment #5
RaulMuroc CreditAttribution: RaulMuroc commentedHas been solved this issue in updated versions? (Currently: 7.x-1.3). If 'yes', please confirm to close this issue.
Comment #6
spyderpie CreditAttribution: spyderpie commentedI would like to know to, I am having this issue as well ... Julie
Comment #7
Achille CreditAttribution: Achille commentedStill not solved for me... I did as in comment #2, but no content is displayed from my Profile2 fields.
Does anyone know a solution?
Comment #8
sepgil CreditAttribution: sepgil commentedHey 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.
Comment #10
sepgil CreditAttribution: sepgil commentedUploading new patch, since the last one was faulty.
Comment #12
sepgil CreditAttribution: sepgil commented#10: 1306146-profil2_pagemanager_support-8.patch queued for re-testing.
Comment #14
sepgil CreditAttribution: sepgil commented#10: 1306146-profil2_pagemanager_support-8.patch queued for re-testing.
Comment #16
sepgil CreditAttribution: sepgil commentedAhhh! 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...
Comment #17
sepgil CreditAttribution: sepgil commentedI 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'.
Comment #18
sepgil CreditAttribution: sepgil commentedHere is an updated patch, which fixes a fatal error for non overridden profiles.
Comment #20
sepgil CreditAttribution: sepgil commentedMy last patch was little bit empty, so here is the proper one.
Comment #22
sepgil CreditAttribution: sepgil commentedAgain, the simpletest failed on drupal.org, but they pass on simpletest.me, so I'm setting this issue to need review.
Comment #23
sepgil CreditAttribution: sepgil commentedComment #23.0
sepgil CreditAttribution: sepgil commentedClarify points.
Comment #24
bojanz CreditAttribution: bojanz commentedThe patch works, but the exported page is always disabled by default. Haven't yet checked why.
Comment #25
RKopacz CreditAttribution: RKopacz commentedI 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.
Comment #26
P2790 CreditAttribution: P2790 commentedHi sepgil,
I apply your patch but don't see a page in pagemanger that I can enable
Comment #27
SpleshkaPlease 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?
Comment #28
P2790 CreditAttribution: P2790 commented@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.
Comment #29
mrded CreditAttribution: mrded commentedPMEP module has some problems with contexts. #2271013: Contexts doesn't work with profile2
It may be problem of profile2, not sure yet.
Comment #30
SalmanEagle CreditAttribution: SalmanEagle commentedHave 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
Comment #31
capfive CreditAttribution: capfive commentedp.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
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 :)
Comment #32
capfive CreditAttribution: capfive commentedOK 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
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!
Comment #33
Leeteq CreditAttribution: Leeteq commentedIf 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.
Comment #34
capfive CreditAttribution: capfive commentedcorrect, 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
Comment #37
ndf CreditAttribution: ndf commentedThis is patch #20 but manually applied on 7.x-1.x branch and the rerolled.
Comment #38
ndf CreditAttribution: ndf commentedPut this on "needs review" to force testing patch #37 by testbot.
Comment #39
ndf CreditAttribution: ndf commentedComment #40
ndf CreditAttribution: ndf commentedCreated 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.
Comment #41
atpaust CreditAttribution: atpaust commentedProfile2 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.