Gravatar Field

The Gravatar custom field gives you the ability to create a unique avatar based on an email address. If a Gravatar user has set-up their Gravatar to a specific image, then that image will appear instead of the random one that gets generated for each account.

How to add a Gravatar Custom Field to Joomla! Articles

The Gravatar field provides you the way to set the pixels of the avatar as well as wheter the avatar image will have round corners.

acf-gravatar-field-settings

As you can see from the screenshot above, after selecting the "ACF - Gravatar" type, the settings for this field will appear.

Let's see what each option does.

Name Description
Name The name will be used to identify the field. Leave this blank and Joomla will fill in a default value from the title.
Label The label of the field to display.
Description A description of the field that will be displayed in the label tooltip.
Required Is this a mandatory field?
Default Value Set the default value of the field
Pixels Enter the avatar size in pixels. Example: 100.
Rounded Avatar Select whether the avatar will have rounded corners.

Usage

Once you are in your Article's Edit screen, choose the "Fields" Tab to see the Gravatar custom field as you can see in the screenshot below.

acf-gravatar-usage

In the input field, you enter an email address that will fetch it's gravatar.

Frontend Display

Take a look at the screenshot below to see how it could be displayed in your frontend.

acf-gravatar-frontend

How to display the author's Gravatar based on their email address

Using the ACF - Gravatar field, you can automatically display the author's Gravatar based on their email address.

To do this, we'll need to use the Smile Pack Joomla extension. This extension provides a module collection, and a plethora of helpful Smart Tags that we can use to display dynamic pieces of information on our Joomla site, including grabbing the current article's author email and use it to display their Gravatar on the article.

Once we've installed Smile Pack, we can then create an ACF - Gravatar custom field and under Default Value, set it to: [email protected]

Each article will automatically display the author's Gravatar based on their email address.

Each article displays a gravatar based on the author email address

Frequently Asked Questions

Can I change the size of the avatar?

You can set any size you desire for the avatar. This size must be set in pixels and changes both width and height. To set the size, enter your pixel amount in the Setting Pixels.

How can I override the layout of "ACF - Gravatar" custom field?

To override the "ACF - Gravatar" custom field, read here: How to override the "ACF - Gravatar" custom field.
Last updated on Nov 26th 2024 12:11