Exercise 8.8: Create a list of users
In this exercise, you’ll make a grid display of user profile pictures like this:
Go to Structure → Views → Add view.
Configure your view with the following settings:
View name: Members
Show Users sorted by Newest first.
Under Create a page, ensure the Display format is Unformatted list of Fields.
Keep the remaining defaults and click Save and edit. You are now in the Advanced settings. At the bottom, you can see a Preview of your new view. What do you see? We will change to show usernames and user pictures.
Under Format - Click to “Unformatted list”. This opens a dialog window. Format to Grid.
Select Grid.
Set Number of columns to 2.
Leave the other settings as their defaults.
Click Apply.
Add user picture
Next, we’ll add the user picture.
Under the Fields settings, click Add..
Search for “profile” and select Profile Image.
Click Add and configure fields..
Select Medium (220 x 220) Image style.
Set the image to Link to Content.
Click Apply.
Add link to Main navigation
Finally, we’ll add a link to the main navigation.
Under Page settings → Menu click the “No menu” link.
Type: Normal menu entry.
Add a menu link title Members.
Scroll down to Menu to select <Main navigation>.
Click Apply.
Scroll down to the Views Preview and review if the results are as expected. Click Save.
Test your new view. In the main navigation, you should have a menu link to “Members”, and a page available at http://example.com/members
Last updated