Welcome Guest, you are in: Login

Subtext Project Site



Search the wiki


Image Image

Configuring Gravatar Support


Hosting graciously provided by

Modified on 2010/01/15 14:32 by Travis Categorized as Customization
A "Gravatar" is a "globally recognized avatar." It's useful for allowing people who read and comment on blogs to create a single, central "profile" (keyed by email address) with their avatar image which is then displayed on all blogs that support these centralized services. Subtext is one of those blogs.

To enable Gravatar support:

  1. Choose a skin that supports Gravatars. If your favorite skin doesn't support it, you can add support by placing the following Image control code into the appropriate spot in the Comments.ascx template in that skin. Note that the comment submission form for the skin also needs to ask the user for their email address, but that level of customization is not discussed here. (For more on skinning, see the main configuration page.)

    <asp:Image runat="server" id="GravatarImg"
    PlaceHolderImage="~/images/shadow.gif" />
  2. Modify web.config to enable Gravatars and select the service to use. Here is the snippet from the web.config file:

    <add key="GravatarEnabled" value="false"/>
    <!-- uncomment to use email2face.com
    <add key="GravatarUrlFormatString" value="http://www.email2face.com/lookup/{0}" />
    <add key="GravatarUrlFormatString"
    value="http://www.gravatar.com/avatar.php?gravatar_id={0}&amp;size=50&amp;default=default_gravatar.png" />
    <add key="GravatarEmailFormat" value="MD5" />

In web.config the values mean...
  • GravatarEnabled: true to enable Gravatar support, false to disable.
  • GravatarUrlFormatString: The remote URL for get the image from. Is a format string (as in String.Format()) and must contain a {0} that will be replaced with the email of the user.
  • GravatarEmailFormat: Defines how the mail should be formatted, plain or hashed with MD5.

Out of the box, Subtext supports two source of Gravatars:
  • Gravatar.com, whose format string is http://www.gravatar.com/avatar.php?gravatar_id={0}&size=50&default=http%3A%2F%2Fwww.somesite.com%2Fsomeimage.jpg
  • email2Face.com, whose format string is http://www.email2face.com/lookup/{0}

ScrewTurn Wiki version Some of the icons created by FamFamFam.