Enabling user pictures (avatars)
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
The Drupal core user module provides pictures (or avatars) for each Drupal user out of the box.
Enabling user pictures
- Navigate to Configuration > People > Account settings.
- In the Personalization settings, select Enable user pictures.
- For Picture directory type pictures
- Under Picture display style, select thumbnail (you can change the size settings
- Click "Save configuration".
Next, ensure your user pictures display in your theme. These are enabled by default in Bartik, the default theme of Drupal 7 , so you may have to check this with any new theme you add.
- Go to Appearance and click "Settings" for the theme you have enabled as default.
- In the Toggle display settings, select User pictures in posts and/or User pictures in comments.
- Click "Save configuration".
Displaying avatar images (in theme)
In the node.tpl.php, use "$node->picture" to get the URL of the image.
Moving images
The database stores the name of the directory you set in Step #3. If you want to move your images to a new directory you must complete the following steps:
- Update the directory identified in the previous section.
- Move existing images to the new directory.
- Update the database manually to use the new directory location. In Drupal 6.x the images are stored in the table
users
.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion