Add Gravatar Support in Joomla with Jumi
Step #1. Install Jumi
- Go to the Jumi page and click the "Download" button.
- You will see two options. Choose the "Download" button for the version of Joomla you are using.
- Login to your Joomla administrator area.
- Go to Extensions > Extensions Manager.
- Click Upload a Package File and upload Jumi. You'll see a success message:
Step #2. Create a Jumi application
Gravatar is based on email addresses, so please make sure you have a Gravatar account and use the same email for your Joomla account.
Now we're going to create a Jumi application to show our gravatar.
- Go to Components >> Jumi >> New
- Fill in the the necessary fields:
- The name of your application
- The custom code. Add this code in Custom Script field to get the Joomla user data and gravatar image based on your email address
<?php $user = JFactory::getUser(); ?> <img src="https://www.gravatar.com/avatar/<?php echo md5($user->email) ; ?>?s=260" />
Step #3. Check the result
- Go to Menus >> Main menu >> Add new menu item
- Fill the required fields:
- Menu Item Type: Jumi Application
- Jumi Application: your application name.
- Click Save & Close.
- Visit your public site and you are logged in, you would see your Gravatar on the page, as in the image below. If you are not logged in, the default gravatar will be displayed instead.
If you don't want to show the Gravatar via a menu link, you can also use Jumi's modules to place the image in a sidebar.
This article is brought to you by OSTraining