How to add "Tweet This" to a node

Ever wanted to add a "Tweet This" to your nodes? Here is how I did it at somoscanada.com. This short tutorial is for people using Drupal.

Open the file node.tpl.php, located under your active theme(sites > all > themes).

At line 96 approximately, add this code(you need to type it!), just before "<?php if ($terms): ?>">. And I am using the Zen theme:

Replace http://somoscanada.com to your domain.

I am using URL Alias(Path module), that's why you see "echo $node->path", it prints the node alias. If you are not using the Path module, then replace that with "php print $node->nid", it prints node/ID.

Last, upload the file node.tpl.php to your server. If you do not see that changes, go to "Site Information > Performance >", empty your cached data.

Share this

Comments

Hello there! I could have

Hello there! I could have sworn I've been to this blog before but after checking through some of the post I
realized it's new to me. Anyhow, I'm definitely
delighted I found it and I'll be bookmarking and checking back
often!

This unique blog post, “How

This unique blog post, “How to add the Tweet This link to
your Zen them using Drupal | Hectorplus.com” displays the fact that u
truly know just what exactly you r communicating about! I personally completely am in agreement.
Many thanks -Nadia

Post new comment