This problem has cropped up a few times in the past but never really resolved. The issue is that if you create a profile type that uses a separate page, there is no ready-made way to see a page belonging to another user, even if you have permission.
I decided to resolve this by adding a pseudo-field to the account page containing links to any profile pages. By going to Configuration->Account Settings->Manage Display, a field named "Profile pages" is available (provided at least one profile type uses page mode). You can position this where you want on the view-account page. When the account is viewed, the field simply contains links to each separate profile page belonging to the displayed user.
Patches to follow.
Comment | File | Size | Author |
---|---|---|---|
#5 | profile2_page_breadcrumb-3134125-5.patch | 705 bytes | RickJ |
#2 | profile2_page_links-7.2-3134125-2.patch | 2.09 KB | RickJ |
#2 | profile2_page_links-7.1-3134125-2.patch | 2.09 KB | RickJ |
Comments
Comment #2
RickJ CreditAttribution: RickJ commentedHere's two versions of the patch, one for 7.x-1.7, one for 7.x-2.0-beta (same code, just different line numbers).
Comment #4
RickJ CreditAttribution: RickJ commentedAs an adjunct to this issue, when viewing another user's separate profile page, there is no direct link back to the user's account page.
This patch adds a breadcrumb to provide that link.
Comment #5
RickJ CreditAttribution: RickJ commentedAnother tweak - the profile page did not generate a browser title. I'm adding it to this issue as it's one more line of code in the same place as the breadcrumbs. Here's the updated patch.
Comment #6
EM-fast1 CreditAttribution: EM-fast1 commentedHello,
I'm using 1.7 and there was no change in behavior after I applied both patches! No profile2 username in the browser (just /profile-main/462) and nothing changed in the User Registration Display settings - no new field was added!
*** I am using PHP 7.3 - could that be a problem ? ***
Comment #7
RickJ CreditAttribution: RickJ commentedDid the patch apply correctly? It was actually built against the 2.0-beta build, but it should work with 1.7 with just a few complaints about line number.
Maybe you're expecting the wrong thing? For the title the URL doesn't change, but the title in the browser top border should now be the Drupal page title, rather than just the site name.
The "field" in first part of this issue appears in the Account Settings (via admin/config), not in any profile. It allows you to embed the links to profile pages in the account page. It works in the same way as you control embedding actual profiles in the account page if you don't use separate profile pages.
There is no effect on the User Registration page.
Comment #8
EM-fast1 CreditAttribution: EM-fast1 commentedHello,
Yes, Now the links are working - in the User Account there is now a heading "Profile Pages" with links to the "Main Profile" and any other profile that the user is assigned to. I think that is working as expected.
I mis-understood the breadcrumbs - theyare now workign as you say. An improvement, thanks. I'd like to get the url to use the profile title intead of a UID number.
Thnk you. The patches are workign for me with 1.7
Comment #9
RickJ CreditAttribution: RickJ commentedGreat, good to hear it's working for you.
Not really anything that can be done about the URL, that's Drupal. It's the same with user account pages, which is core Drupal. You can create named aliases for specific nodes, although not in a generic way. There's no support I know of for doing that with user accounts or profiles.
Comment #10
RickJ CreditAttribution: RickJ commentedComment #12
RickJ CreditAttribution: RickJ commented