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
Comment #2
mach5_kel commentedSolution I added here: https://drupal.org/node/2097289
Comment #3
joco_sp commentedHow 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'.
Comment #4
joco_sp commentedI did it like this, because the solution that mach5_kel suggested don't work on entity's submissions:
Rule:
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.
Comment #5
SebasGoin commentedThanks bro! it works for me!