Very simple PCF Control to show Gravatar


The Gravatar or globally recognised avatar is basically an image associated to our email id, which appears besides our comments, blogs posts, sites etc.

https://en.gravatar.com/site/implement/

To request an image of Gravatar, we need to first calculate hash of the email id and pass it to the URL

The format à

https://www.gravatar.com/avatar/{HASH}

e.g.

https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50

https://en.gravatar.com/site/implement/images/

Using this information, just created a PCF control for single line of text – email type that will show the Gravatar associated to it. It was more from learning perspective than trying to implement a business case or requirement.

This is how the control looks like within the form.

For another email id, it shows the corresponding avatar image.

For cases where there are no gravatar associated it shows the default image

And as we are using it for the email type of text field, the usual validation provided by the platform works seamlessly.

Get the tool here

https://github.com/nishantranacrm/GravatarPCFControl

Hope it helps..

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

One thought on “Very simple PCF Control to show Gravatar”

Please share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.