0

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.

-"USER:UID" 
-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

0

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...? – carrotandme Feb 3 '16 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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