Skip to content

VeXHarbinger/Gravatar-FluidHtmlHelper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Gravatar Fluid Html Helper for Razor and ASP.Net MVC

I just decided to update Andrew Freemantle’s version to be fluid. I just think it makes things simplier.

This is a Fluid HTML Helper implementation of the Gravatar image request API, according the Gravatar documentation, building on the fine work done by Andrew Freemantle.

Features

  • Size

  • Default image (404, mystery-man, identicon, monsterid, wavatar, retro)

  • Custom default image (url)

  • Force default image

  • Ratings

  • Secure requests (HTTPS) is automatic (but can be forced)

  • Image Tooltips

Getting Started

  1. Drop the single GravatarHtmlHelper.cs into your ASP.Net MVC project, be sure to adjust the namespace

  2. Start using it in your Views:

    @Html.GravatarImage("[email protected]")
    @Html.GravatarImage().EmailAddress("[email protected]").Rating(GravatarImage.RatingOptions.R).Size(120)
    @Html.GravatarImage().EmailAddress("[email protected]").Rating(GravatarImage.RatingOptions.R).Size(80).Tooltip("Avatars confirmed via Gravatar.com").DefaultImageUrl("http://SomePath.com/to/your/default/image.jpg.jpg").EncodeDefaultImageUrl(true)
    

Well you get the idea. Hope this helps someone else as well. I’ll clean it up more soon.

About

A simple Gravatar Fluid HTML Helper for Razor and Asp.Net MVC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%