Monday, December 31, 2007

Adding Dynamic StumbleUpon Links To The New Blogger Layouts Template

I noticed in my analytics that I received a large influx of viewers last Friday from StumbleUpon. When I went to there to find their preferred link code, I found that they only had code for the old Blogger. Of course, I had to hack up a solution.

Here's the code for the "Stumble It!" link on Compender:

<style>
html .stumble_link {
padding:2px 0 0 20px;
height:16px;
background:url(http://www.stumbleupon.com/images/icon_su.gif) no-repeat top left;
}
</style>

<script type='text/javascript'>
/*
StumlbeUpon Blogger Link Code
by Raymond May Jr.
http://www.compender.com
*/
var postURL = '<data:post.url/>';
var postTitle = '<data:post.title/>';

document.write("<a class='stumble_link' href='http://www.stumbleupon.com/submit?url=" + postURL + "&amp;title=" + postTitle + "'>Stumble It!</a>");
</script>
Enjoy!

1 comments:

baby~amore' said...

where does it go in the code ?

thanks - I found one last week that added co.mments too ? will they work together

Post a Comment