This blog has moved to http://www.andyjarrett.co.uk/blog/ | New RSS FEED

AddThis button added to my BlogCFC code

I've modified my BlogCFC code a little today. Instead of having the usual Digg/Delicious bookmark links I've swapped them for a Add This button add this which is apparently the #1 bookmarking and sharing button on the Internet.

You need to sign up for a free account but this is only to allow tracking and stats that you view.

When you create your button there is no need to really change the code as its picks up the page URL. But if you want to specify an alternate URL because you want to have the button multiple times on one page then you need to use the addthis_url and addthis_title variables (e.g. addthis_url='http://www.andyjarrett.com/andy/blog/alternate-page.html';).

Below is the code I'm using for BlogCFC. All I've done is removed the Digg and Delicious links in the index.cfm template and replaced it with with the following:


<!-- AddThis Button BEGIN -->
<script type="text/javascript">
    addthis_pub = 'andyj';
    addthis_url = '#application.blog.makeLink(id)#';
    addthis_title = '#application.blog.getProperty("blogTitle")#:#title#';
</script>
<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/button1-addthis.gif" width="125" height="16" border="0" alt="" /></a><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
<!-- AddThis Button END -->

*** Comments *** (*** Comment Moderation is enabled. Your comment will not appear until approved. ***)
Tom's Gravatar You should do this for the Add to Any button here http://www.addtoany.com

It has always been much better that Add This.
# *** Posted By *** Tom | 11/9/08 3:23 PM
BlogCFC was created by Raymond Camden / Contact Blog Owner / mptooling.com / spicemerchants-portsmouth.co.uk / ipicture.it