Giter Club home page Giter Club logo

gravatarhelper's Introduction

GravatarHelper

Build status codecov license

NuGet Package Statistics
GravatarHelper GravatarHelper
GravatarHelper.Common GravatarHelper.Common
GravatarHelper.AspNetCore GravatarHelper.AspNetCore

A set of libraries providing Gravatar support to .NET and .NET Core .

Installation

To install GravatarHelper, run the following command in the Package Manager Console

ASP.NET MVC 3 / 4 / 5:

Install-Package GravatarHelper

ASP.NET Core MVC:

Install-Package GravatarHelper.AspNetCore

and add the following to your _ViewImports.cshtml file:

@using GravatarHelper.Common
@addTagHelper *, GravatarHelper.AspNetCore

Non-MVC:

Install-Package GravatarHelper.Common

Example Usages

GravatarHelper

Create a Gravatar img tag for "[email protected]", 80 pixels large with "My Gravatar" as title and "Gravatar" as alt text.

@Html.Gravatar("[email protected]", 80, new { Title = "My Gravatar", Alt = "Gravatar" })

Create a Gravatar link for "[email protected]", 80 pixels large with "Identicon" as the default image.

<a href="@Url.Gravatar("MyEmailAddress@example.com", 80, GravatarHelper.DefaultImageIdenticon)">Your Gravatar</a>

Create a Gravatar Profile link for "[email protected]".

<a href="@Url.GravatarProfile("MyEmailAddress@example.com")">Your Gravatar Profile</a>

GravatarHelper.AspNetCore

<img gravatar-email="[email protected]" gravatar-size="80" alt="My Gravatar" />

Troubleshooting

GravatarHelper

The NuGet package should by default add two using statements to the /views/web.config file allowing Gravatar extension methods to be used throughout all view files. If this fails then you can manually add the following two namespaces to the /views/web.config file:

<system.web.webPages.razor>
  <pages>
    <namespaces>
      <add namespace="GravatarHelper.Common" />
      <add namespace="GravatarHelper.Extensions" />
    </namespaces>
  </pages>
</system.web.webPages.razor>

Or alternatively add the namespace directly to the relevant view files:

@using GravatarHelper.Common
@using GravatarHelper.Extensions

License

GravatarHelper is licensed under the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication

gravatarhelper's People

Contributors

jkommer avatar tischlda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.