As you can see at the bottom of each blog post, I’ve added social bookmark links.
Because I use dasBlog version 1.8 it was very
difficult to do, mainly because there is no macro to print out the title in clear
text of the individual blog posts. Michal showed us how to add
the macro to dasBlog in a very easy way. The only problem is, that I’ve uninstalled
Visual Studio 2003 and I don’t want to install it again just to add a macro to my
blog.
I knew that the only way to do it was by JavaScript and I didn’t like it at all. But
in the end, it turned out pretty good. This is the JavaScript that I added to the
footer of the ItemTemplate:
<script type="text/javascript">
var
tn = document.createTextNode('<%ItemTitle%>');
var
div = document.createElement('div');
div.appendChild(tn);
var
html = div.innerHTML;
var
index = html.indexOf('>')
+4;
var
title = html.substring(index, html.length - 10);
var
social = '<div style="float:left">';
social
+= '<a href="http://digg.com/submit?phase=2&url=<%permalinkUrl%>&title='
+ title + '">Digg it</a> | ';
social
+= '<a href="http://www.dzone.com/links/add.html?url=<%permalinkUrl%>&title='
+ title + '">dzone it</a> | ';
social
+= '<a href="http://www.dotnetkicks.com/submit?url=<%permalinkUrl%>&title='
+ title + '">Kick it</a>';
social
+= '</div>';
document.writeln(social);
</script>
You can fairly easy add other bookmarks than the ones I’ve implementet. If you use
the new dasBlog 1.9 you don’t have these problems, because it come with the blog post
title macro out of the box.
>
* $4.95/month BlogEngine.net Hosting – Click Here!