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: Twitter button template


Tip: Twitter button template

Saturday 17 September 2011 8:59:51 pm

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

In this post I will show how to include the twitter button.

Please check also the tip about the google plus one button.

So, create a file called 'twitterbutton.tpl' inside your design template folder. Put this content in the file:

{ezscript_require( array('ezjsc::jquery','') )}
{def $c=cond( is_set($count), $count, 'horizontal' )}
<a href="" class="twitter-share-button" data-count="{$c}"
{if is_set($via)} data-via="{$via}"{/if}
{if is_set($text)} data-text="{$text}"{/if}
{if is_set($url)} data-url="{$url}"{/if}
{if is_set($lang)} data-lang="{$lang}"{/if}>Tweet</a>

Now you can use this template this way:

{include uri="design:twitterbutton.tpl" via="ezcommunity" text="hello world!" url="" lang="en" count="vertical"}

Please note that via, text, url, lang and count are optional values, you can check the twitter button doc for more info.

Proudly Developed with from