This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Blogs » Thiago Campos Viana » Tip: Google plus one button


Tip: Google plus one button

Saturday 17 September 2011 8:10:36 pm

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

In this post I will show how to create a simple template for the google plus one button.

First you'll need to create a template inside your design template folder with the name "plusone.tpl". Put this content in this file:

{ezscript_require( array('ezjsc::jquery','') )}
{def $plusid=rand( 1, 1000 )
     $s=cond( is_set($size), $size, 'standard' )
<span id="plusone-span{$plusid}"></span>
<script language="javascript">
        function (){ldelim}
                {ldelim}"size": "{$s}" {if is_set($href)},"href":"{$href}"{/if} {rdelim}

Now you can use this template by using the include template operator, you can specify the size and the href attribute, please check the plusone doc for more info.

Here are some samples:

{include uri="design:plusone.tpl"}
{include uri="design:plusone.tpl" size="tall" href=""}
{include uri="design:plusone.tpl" size="tall"}
{include uri="design:plusone.tpl" href=""}

You can check also my post about how to create a google login module view.

Proudly Developed with from