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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RickJ created an issue. See original summary.

RickJ’s picture

Assigned: RickJ » Unassigned
Status: Active » Needs review
FileSize
2.09 KB
2.09 KB

Here'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).

  • 7c8861e committed on 7.x-2.x
    Issue #3134125 by RickJ: Provide a way to view other users' profile...
RickJ’s picture

As 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.

RickJ’s picture

FileSize
705 bytes

Another 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.

EM-fast1’s picture

Hello,

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 ? ***

RickJ’s picture

Did 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.

EM-fast1’s picture

Hello,

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

RickJ’s picture

Great, 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.

RickJ’s picture

Status: Needs review » Reviewed & tested by the community

  • 687d8c8 committed on 7.x-2.x
    Issue #3134125 by RickJ: Add breadcrumb link to account page
    
  • 7a400a0 committed on 7.x-2.x
    Issue #3134125 by RickJ: Add breadcrumb link to account page, and add...
RickJ’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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