User Display aims at providing a centralized configuration and extendable API to consistently display user names and pictures (avatars) across a site. By supporting User Display's API, third party modules give site owners complete control over how user names and pictures should be shown. For example, users in the "Who's online" block may be displayed with their picture only, while users in comments could be shown with their name, picture, and other elements.
Another feature of User Display is the Action Links submodule, an AHAH driven, customizable context menu for user links, allowing users to execute various user related actions, for example write a private message or add a user to the buddy list.
Please note this module is currently in alpha stage, and lacks a usable administrative UI. The core functionality, however, is already working, but needs to be "configured" by manipulating the $conf array in settings.php.
Users are visually represented by display styles. A style can consist of various configurable elements that we call decorators, for example user name, picture, online status, role, etc. By leveraging User Display's API, third party modules are able to extend the available elements, for example add a country flag based on user profile data.
Third party modules that wish to integrate User Display are required to append a (more or less) unique display class to user related theme calls, and make this list available to User Display. See "Developer info" below for more information.
- User Display has built-in support for ImageCache (for consistent user pictures across the site) and Views.
- Support for Drupal core output (i.e. blocks, nodes, comments) requires a patch for phptemplate.engine.
- Contrib modules that (will) support User Display: Guestbook, Buddylist, Privatemsg
- Please see current README.txt.
You are the author of a module and want to give back site owners control over how to display user names and pictures? Great! You can support User Display by adding a display class (much like a CSS class, although CSS isn't involved here, and rather used as analogy) to all relevant theme('username') and theme('user_picture') calls. For example, if your module displays a status block with user names by default, all you have to do is adding the class name 'mymodule_block_status' as additional argument like this:
$output .= theme('username', $account, 'mymodule_block_status');
By implementing hook_user_display(), your module may then assign a title and description for each available class name, which in turn can be used by site admins to control the visual representation (display more than just the username, for example). And the best thing: because the core theme functions don't use the added parameter, your code is still fully backwards compatible! There are no nasty module_exists() hacks required to support User Display.
This project has been sponsored by:
- unleashed mind
Specialized in consulting and development of Drupal powered sites, our services include installation, development, theming, customization, and hosting to get you started. Visit http://www.unleashedmind.com for more information.