Enabling user pictures (avatars)

Last updated on
30 September 2016

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

  1. Navigate to Configuration > People > Account settings.
  2. In the Personalization settings, select Enable user pictures.
  3. For Picture directory type pictures
  4. Under Picture display style, select thumbnail (you can change the size settings
  5. 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.

  1. Go to Appearance and click "Settings" for the theme you have enabled as default.
  2. In the Toggle display settings, select User pictures in posts and/or User pictures in comments.
  3. 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:

  1. Update the directory identified in the previous section.
  2. Move existing images to the new directory.
  3. 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

Page status: No known problems

You can: