Adding to Tumblr
Dan has added a TweetMeme button to his Tumblr blog. It didn’t take him long to figure out where it should go in his theme, TweetMeme have a good system so installing it is quite simple. TweetMeme didn’t seem to pick up on individual post URLs without including the call to the permalink which is why you need to remember to include the line below:
tweetmeme_url = '{Permalink}';
Here’s how I did it…
You need to put this javascript:
<script type="text/javascript">
tweetmeme_url = '{Permalink}';
tweetmeme_source = 'YOUR TWITTER USERNAME';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
somewhere in between {block:Posts} <div class=”post”> and </div> {/block:Posts} so that it can use {Permalink}, otherwise it’ll just try to tweet your whole website.
Obviously you should put your twitter username where it says “source =”, or else delete that whole line to have “RT @tweetmeme” sent in the tweet instead.
If you’ve got a theme similar to mine, it might help to see the code in context, so here’s what my rather messy HTML looks like:
{block:Posts}
<div class="post">
{block:NewDayDate}
<div class="date">
<script type="text/javascript">
tweetmeme_url = '{Permalink}';
tweetmeme_source = 'mled';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script><br><a href="{Permalink}">{ShortMonth} <span class="day">{DayOfMonthWithZero}</span> {Year}</a></div>
{/block:NewDayDate}
{block:SameDayDate}
<div class="date">
<script type="text/javascript">
tweetmeme_url = '{Permalink}';
tweetmeme_source = 'mled';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script><br><a href="{Permalink}">{ShortMonth} <span class="day">{DayOfMonthWithZero}</span> {Year}</a>
</div>
{/block:SameDayDate}
There’s an alternative Tweetmeme button which is much more compact, and you can use that by adding this line:
tweetmeme_style = 'compact';
before the first </script>
If you’re still stuck there’s a help page on TweetMeme which describes the choices for customising the button and lists all the code snippets you’ll need.
—————————————————
Many thanks to Dan Monsieurle of http://open.mled.me for the How To article shown above!



(12 votes, average: 3.25 out of 5)