I'm using Drupal7.

I wanted to display some fields from user account in profile2 page by using Views. I tried to do this by using views block and views_embed_view() coded in profile2--ProfileType.tpl.php for profile2 page.

So, I created a view and set contextual filter like below.

-the default value is "User ID From URL"

But that doesn't display View in profile2 page even though the URL is "Mydomain.com/profile-My_Profile_Type/User_ID". On the other hand, that View works in the user account page. So, this means that it may be because contextual filter of "User ID From URL" doesn't work in the profile2 page even though its URL has User ID. I changed the contextual filter from "USER:UID" to "(Profile) Profile: User uid", but it doesn't work either...

Can anybody give me the advice how to make it work?

Thank you

1 Answer 1


If the url schema is alway the same, you can use the default value "Raw value from url" instead of "User Id from URL" and set the 'path component' in your example to '3' to get the user id.

  • thank you for your reply. I tried the way you suggested. But it doesn't work... So doesn't it mean it's impossible to get some value from URL in Profile2 page...? Feb 3, 2016 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.