# How do you include a user's default image in a Drupal 7 view that lists people?

I have a view in Drupal 7 that lists people (users). It shows the username and the standard user picture field. If a user has a set image, it comes through perfectly. However, for users that didn't set a profile image no image is shown, even though I have a default profile image set in the people settings for the site.

How do I get views to use the default profile picture for people that do not have a profile image set?

Update: I wasn't clear. I know how to use the default image in the no results behavior. The issue is that I can't get the default image to use the imagestyle I use for the other images.

Verify that your view does not have hide if empty checked.

• I should have been more clear. I know how to do that (and tried it). The problem is I can't get the image to pass through image cache to get the right size outputted. – Justin May 22 '12 at 15:30
• How many of these are you doing? Would it make sense to cut the image yourself and link to it? Or are you using many instances in different sizes? – Aaron Ortega May 22 '12 at 16:36
• Yah, for this view just the one reduced size. I went ahead and cut the image myself. – Justin May 22 '12 at 16:42
• In the future you can do a custom template for that field. Using PHP you can write a conditional that displays if the field is blank and call the image style that you're using for resizing – Aaron Ortega May 22 '12 at 16:57
• @Justin: this is NOT A SOLUTION! You should mark Marijke Luttekes's answer as accepted, because her answer REALLY solves the problem! Please look at my comment, I just tried it, and her solution worked perfectly. Thanks for changing the accepted answer to hers! :) – Sk8erPeter Sep 9 '12 at 18:54

I have just found the answer to this question via Drupal.org. You have to use a URI like this:

public://user_pictures/default.png


Here, public:// stands for your public files location (often sites/default/files/). What comes after that, is the location of your image within public files. If you do this, the default image is treated like normal user images.
• +1, wow, you were absolutely right! On the admin/config/people/accounts site, I firstly set the default picture to sites/default/files/user-pictures/person.png; the result: no default images displayed in my view where I list users; after changing the path to public://user-pictures/person.png, the default picture appeared! I didn't think this is so simple. Thank you! :) – Sk8erPeter Sep 9 '12 at 18:53