Add an author token

With this token type, you can add author information on your page. In this way, author profile photo will show up in search results:

Image taken from Google's Rich Testing Tools

First of all, you have to configure your Google+ profile; then edit the Contributor To section. In the dialog that appears, click Add custom link and enter the website URL, then click Save.

[Note]Note

As you can imagine, you can test author tokens on live sites only; you can't do it on localhost, since Google can't reach it!

Then surf on the Authors view and click on Synch Authors. In this way you'll import existant users inside J4Schema.

Don't worry, only new users will be imported, so you can run this operation every time you want. However, if you want, you can manually add a single user, clicking on the New button.

For each author, you have to insert his google profile id:

Well, you're done! If you test your page, you should see a nice image of your profile next to the search result!

Add an author token manually

If you want to add the author token in an already existant template override (or in another part of your site), you have to follow these steps.

First of all, you have to create a Google+ token, and assign it a name.

Then, in your template override, you have to place your token in this way:

Example 5.4. Google+ Token

<a href ="{ GOOGLE_PLUS_AUTHOR:<?php echo $this->item->created_by?> }">
  <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
</a>


As you can see, the token is made by two part: the token name and the userid of the author, joined together by a semicolon ( : ). In this way J4Schema can check if there is a linked Google+ profile and create a correct link.