[SOLVED][Drupal Views] How to display profile info of the current user in a View

| | 1 min read

A few users wanted a particular feature using Drupal Views in their Drupal sites. They wanted to have a Drupal Views block which should display the profile of the current user. The currently logged in user should be able to see their profile information but at the same time they should not be able to view the info of the other users. Read on to find out how to implement this feature in your Drupal site.

  • In the Advanced section of the Views Admin UI in the Relationships field, click on Add
  • Select "Profile: User uid"
  • In the next screen under "Configure Relationship: Profile: User uid"
    • Retain all the other settings and check the box for "Require this relationship"
    • Apply the changes made.
  • Next proceed to "Filter criteria"and select the "Add" button
  • Check the box for "User: Current" and then click on the "Apply" button down below.
  • In the next screen under "Configure filter criterion: User: Current"
    • For the Relationship field select [User]
    • Next select "Yes" for the "Is the logged in user field."
    • Apply the changes
  • Finally save the current View settings.

Hope that helps.

The easiest way to solve a Drupal issue is to hand it to the Drupal experts. We can provide a wide range of Drupal services to help you maintain and manage your Drupal websites.Get in touch with us to know more.