advance mode

 

For using gAvatar in Advanced Template mode, you have to override Joomla’s output. You can find the necessary information about this on Joomla! documentation.

If you set the “Display Mode” to “Advanced Template”, the plugin adds “avatar” as an array property to the article object. then you can use it everywehere on your layout.

The avatar array itself have these properties:

$avatar = array (
'src' => string // URL to the avatar image
'width' => int // Width of the avatar image
'height' => int // Height of the avatar image
'fullname' => string | bool // Full name of the user. false if not suppose to show.
'profile' => string // URL to the user profile if exists
);

On your layout you can use something like this :

<?php if (isset($this->article->avatar)) : ?>
<a href="<?php echo $this->article->avatar['profile']; ?>" title="<?php echo $this->article->avatar['fullname']; ?>">
<img src="<?php echo $this->article->avatar['src']; ?>" width="<?php echo $this->article->avatar['width']; ?>" height="<?php echo $this->article->avatar['height']; ?>" />
</a>
<?php endif; ?>

Please note that Joomla! uses item instead of article on frontpage, section and category view overrides. So it’s like :

<?php if (isset($this->item->avatar)) : ?>
<a href="<?php echo $this->item->avatar['profile']; ?>" title="<?php echo $this->item->avatar['fullname']; ?>">
<img src="<?php echo $this->item->avatar['src']; ?>" width="<?php echo $this->item->avatar['width']; ?>" height="<?php echo $this->item->avatar['height']; ?>" />
</a>
<?php endif; ?>