Hi,

I currently have both Profile2 and Views installed. I've been trying to get a listing of users with links to their Profile2 page. This way, I can have a page where admin users can view and edit those profile pages. However, there doesn't seem to be that relationship in Views. How would I get this listing? I've looked all over and no answers. Can someone please help? Thanks!

Comments

aquariumtap’s picture

subscribe

smiletrl’s picture

Version: 7.x-1.0-beta3 » 7.x-1.0-beta4

I'm using version beta4.
Currently I'm using users' picture linked to the profile page. If you have added an image field to profile2, you'll find a configuration "image link to" when you configure this image field.And this selecting list contains three options:nothing,content and file.I select the option "content", and this image in views will link to the users profile page.
On the other hand, if you want to add this profile page link to any other fields text in views, you can use the REWRITE RESULTS configuration. Check "Output this field as a link" under rewriting results and give the link path below.But I haven't figured it out how to dynamically provide the profile page link to corresponding users.
May this will help.

shadowdknight’s picture

Version: 7.x-1.0-beta4 » 7.x-1.0

I cant find such option in 7.x.1.

Thanks

shadowdknight’s picture

Sorry, it seems you meant those are options in View

smiletrl’s picture

You may check it here http://drupal.org/node/1074296

aniebel’s picture

Not sure if this helps: http://drupal.org/node/1334074

kevinquillen’s picture

Version: 7.x-1.0 » 7.x-1.2

How do you utilize the alias of a Profile2 entity instead of the user alias on the User entity? I want to use the Profile2 alias for better SEO, the token options I have for that are not available on the User entity for aliasing under Pathauto.

aufumy’s picture

I was able to use pathauto for profile 2, when enabling the sandbox pathauto entity module and the entity tokens module.

Oceanman’s picture

@Kevinquillen I was able to alias my profiles using rules to set the url. This was helpful because I could have different sets of tokens for different profile types. I did not use Pathauto.

Regarding your quest for better SEO, how do you set your HTML metatags in the header for your profiles? Any viable solution would be welcome, this is my issue regarding metatags in profiles:
http://drupal.org/node/1621328

kevinquillen’s picture

Metatags are one thing, aliases are another... I settled on static/users/fname-lname

oystercrackher’s picture

@oceanman

Can you please advise what type of trigger, condition, and action you placed in your rule to create url aliases for profile2?

I have tried "AFTER SAVING NEW PROFILE" with

{ "rules_create_url_alias_for_an_indiv_profile_using_profile2_2" : {
"LABEL" : "Create URL alias for an individual profile using profile2 #2",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "path", "profile2" ],
"ON" : [ "profile2_insert" ],
"IF" : [
{ "entity_is_of_type" : { "entity" : [ "profile2:user:profile-main" ], "type" : "profile2" } }
],
"DO" : [
{ "drupal_message" : { "message" : "Creating alias of community\/members\/[profile2:user]\/profile for [profile2:url] FROM PROFILE" } },
{ "path_alias" : {
"source" : "[profile2:url]\r\n",
"alias" : "community\/members\/[profile2:user]\/profile",
"language" : [ "" ]
}
}
]
}
}

I also tried "AFTER SAVING NEW USER ACCOUNT" with

{ "rules_create_url_alias_for_an_individual_profile_using_profile2" : {
"LABEL" : "Create URL alias for an individual profile using profile2",
"PLUGIN" : "reaction rule",
"ACTIVE" : false,
"REQUIRES" : [ "rules", "path" ],
"ON" : [ "user_insert" ],
"IF" : [
{ "user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "6" : "6" } } } }
],
"DO" : [
{ "drupal_message" : { "message" : "Creating alias of community\/members\/[account:name]\/profile for [account:profile-main] FROM ACCOUNT" } },
{ "path_alias" : {
"source" : "[account:profile-main]\r\n",
"alias" : "community\/members\/[account:name]\/profile",
"language" : [ "" ]
}
}
]
}
}

I am using profile2 registration path module in addition to profile2. Neither one seems to work in creating aliases.

Looking forward to your reply.

Thanks
Melissa