Skip to content

Using local and Gravatar userpics

Nick-smallworld edited this page Apr 28, 2011 · 4 revisions

Overview

This recipe shows how to display a userpic in MT if it exists, and if not, to fall back to gravatar.

Get the Plugin

Recipe

Enables user icon pictures from the Gravatar service.

    <mt:IfNonEmpty tag="CommenterUserpic">
        <mt:CommenterUserpicAsset>
            <img src="<mt:AssetThumbnailURL width="32" height="32">" width="32" height="32" alt="<mt:CommentAuthor />" class="avatar" />
        </mt:commenteruserpicasset>
    <mt:Else>
        <img src="<$MTGravatar rating="g" default="static-URL/images/default-userpic-36.jpg" size="32"$>" alt="<mt:CommentAuthor />" width="32" height="32" class="avatar" />
    </mt:ifnonempty>
Clone this wiki locally