1

I would like to select fields associated with users and display the outputs on users' profile page. In other words, when someone navigates on a user's profile page, the outputs of the selected fields get displayed.

I tried to do that with a user views and I tried setting up different types of contextual filters (such as 'user ID', Provide Default Value, User ID from URL). But nothing seems to be work, the view does not display. When I remove the contextual filter, the view does display on the page so the problem seems to originate from the filter I selected or how I set it up.

The problem is probably really simple but I'm missing something here. Any hint?

Thanks a lot!

2

Looks like you may be looking for Viewfield module:

Viewfield provides a field that holds a reference to a View and renders it whenever the entity containing the field is displayed.

Install it, and add viewfield to user profile just like you would add any other field.

Alternatively you can create a block display and choose to display only in /user/* paths, using contextual filters. This is the way I like less, as it is more prone to fail if someone will redesign URL system on page, or choose to display users in a way other than default.

Exact steps

As described by OP in comment below:

  1. I created a view and added a contextual filter (Profile: User UID => Display all results for the specified field => Specify validation criteria/Basic validation);
  2. created a view field in the Main Profile page; and
  3. selected the token [profile2:user:uid] from the placeholder tokens' list and checked the box "Always use default value".
0

You should create a view as block on the page you want to display.
This will do the needful.

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.