1st post here, so I apologize for any breaches of etiquette. I've been trying for a while to simply have a redirect to the Profile 2 profile when a user clicks on another user account link. I figured this would be useful for forums, blogs, etc. I didn't want to have to put a link to the p2 profile in every content type, so I just made a simple rule along the format:
if a user acct is clicked, redirect to their p2 profile.

The problem I encountered was with multiple profile types.
The best I can figure is that you need a rule for each profile type to be structured as follows:

Event: user account page is viewed
Condition1: current-user is not viewed user
Condition2: user has roles (to match the profile2 profile type. I have it set so that each role has a different p2 profile type.)
Action: Page redirect. Data Selection type. account:profile-(machine name of type of profile):url

I hope this helps as a simple work-around.

If anyone has a simpler way to do this, let me know. I'd appreciate it.

Comments

Status: Fixed » Closed (fixed)

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

mach5_kel’s picture

Solution I added here: https://drupal.org/node/2097289

joco_sp’s picture

How to do the Condition1: current-user is not viewed user?
For the condition under 'User' I can only choose: 'User has role(s)' and 'User is blocked'.

joco_sp’s picture

I did it like this, because the solution that mach5_kel suggested don't work on entity's submissions:

Rule:

Event:
User account page is viewed

Condition:
NOT Data comparison
Parameter: Data to compare: [site:current-page:url], Data value: user

Actions:
Page redirect
Parameter: URL: [account:profile-'machine name of your profile':url]

I don't know how to do the Condition1, so I did it like this. Because I don't want to redirect the user when he clicks on his 'User account'.
'Data value: user' is the URL I don't want to use this Action (http://example.com/user).

I'm a newbie using Rules, so maybe this is not the best solution. I posted it, because it worked for me.

SebasGoin’s picture

Issue summary: View changes

Thanks bro! it works for me!