Updated 7/10/09: Code updated with snippet to prevent looping of Internet Explorer 7 “Loading…” icon.

AddThis provides an easy way to allow readers of your blog to post to popular bookmark and social networking sites like delicious and digg. This post describes how to add an AddThis Share button at the end of your dasBlog postings.

1. Visit AddThis – Get Your Button and select the “Bookmarking and Sharing” button style of your choice.

image

2. Open your current theme’s itemTemplate.blogtemplate file for editing.

3. Modify the template code which appears after the post content to display the button and link it to your post permanent URL (PermalinkUrl macro) and title (itemTitleRaw macro). Here’s how the code looks in my theme itemTemplate.blogtemplate file (replace the values for the v and pub parameters below with the corresponding value returned when you obtained your script code in step 1):

<!-- AddThis Button BEGIN -->
<script type="text/javascript">
    var addthis_disable_flash = true;
</script>
<a href="http://www.addthis.com/bookmark.php?v=ZZZ&pub=ZZZZZZZZZZZZZZZZ" 
onmouseover="return addthis_open(this, '', '<%PermalinkUrl%>', '<%itemTitleRaw%>')" 
onmouseout="addthis_close()" onclick="return addthis_sendto()">
<img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="vertical-align:bottom; border:0"/></a>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=ZZZZZZZZZZZZZZZZ"></script>
<!-- AddThis Button END -->


4. Restart the IIS web site so dasBlog will reload your itemTemplate. If you can’t restart IIS directly, a trick to accomplish the same result is to add a blank line to Web.config and save it (ASP.NET automatically restarts a web application when Web.config is updated).

Bookmark and Share  Comments [0] | Permalink | dasBlog | WebDesign

Leave a Comment

Name (required)
Email (will not be published)
Website
 

Comment Preview
Subscribe
Top 5 Posts
Add Google Analytics to a SharePoint Publishing Site
Integrating jQuery 1.3, ASP.NET 3.5 Visual Studio 2008
Add Custom Table Formats to SharePoint Content Editor
Configuring log4net for SharePoint Windows Authentication
Convert Visual Studio 2008 Class Library Project to Web Application Project
Tags
ASP.NET (5) dasBlog (5) GoogleAnalytics (2) jQuery (1) log4net (2) SharePoint (18) WebDesign (3)
 
 
 
Spreadfirefox Affiliate Button
 
Download Notepad++