Recently on the mailinglist, it was mentioned that a patch to add theme-based avatar display would be desirable. (1) In response, I've created the attached patch for xtemplate that adds OPTIONAL support for avatars. Before I say anything about the patch, let me stress that it changes NOTHING for those who don't wish to use avatars, and as a default setting they remain OFF.

This patch adds to the xtemplate admin interface two checkboxes, one for enabling avatars for nodes, and another for comments. To maintain a consistent appearance for all posts, admins can also specify a "default avatar" for users who have not uploaded a personalized avatar. (or specify none and the avatar will be omitted for these users) The changes to the template are quite minor (an additional div which is skipped if not using avatars), as are the changes to CSS (the addition of a ".node .avatar" and ".comment .avatar" class used only for positioning). ALT text is available for avatars, stating "USERNAME's avatar," and all strings are translatable.

Hopefully, this patch is minor enough that it won't bother anyone not using avatars. I feel that it's important to get this into core (a.) to complete the partial avatar functionality provided by profile.module and (b.) to provide an example to those creating custom themes on how to use avatars.

Thank you for your time in considering this patch. As always, any and all comments are welcomed.

1 => http://lists.drupal.org/archives/drupal-devel/2004-02/msg00352.html

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dries’s picture

Committed to HEAD. Thanks. It would be nice if the avatars were links to the user's profile page.

TDobes’s picture

Good idea. The attached patch makes the avatars links to the user's profile page.

Dries’s picture

Committed to HEAD. Thanks.

Anonymous’s picture