Create a friendly invite to Tweet your articles

The Twitter service is more popular than ever today. This simple code will render an invitation to Tweet your articles and display a pre-formated TinyUrl link within Twitter.

In your article form or page template:

<p><a href="'<txp:php>echo file_get_contents("".permlink(array())).'\'%3E'.$thisarticle['url_title'];</txp:php>%3C/a%3E" title="Publiez sur Twitter!" class="tooltip" onclick="; return false;">Tweet!</a></p>

Add the code to your article form or page template, and your visitors will see a Twitter icon which when clicked will result in a Tweet that looks like so:

I am currently reading <a href=''>your_TXP_article_title</a>

Please note that if you want to display a Twitter icon, you will need to download and store the image in a folder called /img in your web root, otherwise you will need to edit the code above.


comments powered by Disqus