Last updated by domix 3 years ago
Avatar Plugin
This plugin provides a taglib for displaying avatars.At the moment we only support gravatars (globally-recognized avatars).Gravatars allow users to configure an avatar to go with their email address at a central location: gravatar.com. Gravatar-aware websites can then look up and display each user‘s preferred avatar, without having to handle avatar management. The user gets the benefit of not having to set up an avatar for each site that they post on.
Authors
- Domingo Suarez Torres
- Dmitriy Kopylenko
Code
Plugin code is located at GitHub http://github.com/domix/avatarplugin/tree/masterInstallation
'grails install-plugin avatar'
Usage
The plugin usage is quite simple.Example:<avatar:gravatar email="${user.email}"/><img alt="Gravatar" class="avatar" height="20" src="https://secure.gravatar.com/avatar/f2f68f9b5281cd7c2eb7eecba1" width="20" />
- heigth & width
- CSS class
- alt
<avatar:gravatar email="${user.email}" alt="My Avatar" cssClass="myCss" size="50"/>
<img alt="My Avatar" class="myCss" height="50" src="https://secure.gravatar.com/avatar/f2f68f9b2814cd7c2eb7eecb9c" width="50" />
<avatar:gravatar email="${user.email}" defaultGravatarUrl="${'http://mydomain.com/images/default-gravatar-80.png'.encodeAsURL()}" />
<avatar:gravatar email="${user.email}" gravatarRating="G" />
Configuration
To avoid expensive configuration each time plugin usage, you can configure global settings as follows:In Config.groovyavatarPlugin {
defaultGravatarUrl="""http://yourdomain.com/images/default-gravatar-80.png"""
gravatarRating="G"
}


