{"id":317,"date":"2009-06-07T12:36:46","date_gmt":"2009-06-07T12:36:46","guid":{"rendered":"http:\/\/blog.cyberwizzard.nl\/?p=317"},"modified":"2016-03-17T21:23:25","modified_gmt":"2016-03-17T20:23:25","slug":"adding-gravatar-to-joomla","status":"publish","type":"post","link":"https:\/\/blog.cyberwizzard.nl\/?p=317","title":{"rendered":"Adding Gravatar to Joomla!"},"content":{"rendered":"<p>After stumbling upon Gravatar, a site serving your avatar globally, I looked for an easy way to add this functionality to Joomla!. After ditching Gravatar\/Avatar for needing some other plugin to work in the first place, I&nbsp;installed gAvatar.<\/p>\n<p>This plugin worked without dependencies and gAvatar is dead simple to set up. Just enable the plugin, change the rendering mode and you are done.<\/p>\n<p>The only thing that can go wrong (and did for me) was the fact that you can choose for a floating avatar (which ended up floating in the text), a table avatar (using the default Joomla header style &#8211; which this site doesn&#8217;t use) or advanced templating.<\/p>\n<p>That last option seemed like a good solution except that nowhere was described what it did or how it worked. A quick dive in the source showed me everything I needed to know: gAvatar adds a &#8216;avatar&#8217; parameter to the article object. To use it, find the classes generating the article layouts and modify those.<\/p>\n<p>To find those class files, I&nbsp;used the following in the template folder:<\/p>\n<p><code>fgrep &quot;article-&gt;text&quot; * -R<\/code><\/p>\n<p>And add the following (for example) to insert the avatar:<\/p>\n<pre xml:lang=\"php\">&lt;?php if (isset($this-&gt;article-&gt;avatar)) : ?&gt;     &lt;div style=&quot;float: right&quot;&gt;&lt;?php echo $this-&gt;article-&gt;avatar; ?&gt;&lt;\/div&gt; &lt;?php endif; ?&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>After stumbling upon Gravatar, a site serving your avatar globally, I looked for an easy way to add this functionality to Joomla!. After ditching Gravatar\/Avatar for needing some other plugin to work in the first place, I&nbsp;installed gAvatar. This plugin worked without dependencies and gAvatar is dead simple to set up. Just enable the plugin, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[362,363,30,459],"class_list":["post-317","post","type-post","status-publish","format-standard","hentry","category-programming","tag-avatar","tag-gravatar","tag-joomla","tag-not_ok"],"views":2274,"_links":{"self":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=317"}],"version-history":[{"count":1,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/317\/revisions"}],"predecessor-version":[{"id":421,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/317\/revisions\/421"}],"wp:attachment":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}