I don't believe the avatar is exposed as a property of a published page. The best you can get from this is the ID of the person who created (or edited) the page. But from the ID you can then get a reference to the User. Something like:
var user = UmbracoContext.Current.Application.Services.UserService.GetUserById(Model.Content.CreatorId);
string email = user.Email;
I believe Umbraco just uses Gravatar for images, so all you need is to create a hash of the email address and call their simple API. There's an example of how to do this below:
Get avatar of publisher
Hi there, I'm in the process of creating a bespoke blog for our site, I want to call the avatar image of the user who posted the blog article.
I can call the publishing date and the user like this:
Is there a way to call the avatar of the user in a similar fashion?
Thanks.
I don't believe the avatar is exposed as a property of a published page. The best you can get from this is the ID of the person who created (or edited) the page. But from the ID you can then get a reference to the User. Something like:
I believe Umbraco just uses Gravatar for images, so all you need is to create a hash of the email address and call their simple API. There's an example of how to do this below:
http://stackoverflow.com/questions/3561477/asp-net-mvc-helper-for-accessing-gravatar-images
Ah that's unfortunate, thanks for your prompt response!
is working on a reply...