Tuesday, October 23, 2007

How to add DZone voting to your Blogger blog

Update:Formatted XML and removed top-level div tag and added instruction to expand widget template, thanks to James.

DZone released voting scripts which allows site visitors to vote from the site itself. You can find voting widgets for Wordpress as well as for Jroller, but nothing for blogger :(.

So here's simplest way to add it to your Blogger blog, Just copy/paste lines below to your Blogger HTML template (after expanding widget templates):
<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>var dzone_url = '<data:post.url/>'</script>
<script type='text/javascript'>var dzone_title = '<data:post.title/>'</script>
<script type='text/javascript'>var dzone_style = 1</script>
<script language='javascript' src='http://widgets.dzone.com/widgets/zoneit.js'/>
</div>


right before

<p><data:post.body/></p>


Here's the image screen shot:



Click on it to enlarge. You might want to customize it a bit, just try out different div styles. Developers, Keep voting!

14 comments:

Ben said...

It seems the 'dzone_style' value needs to be in quoates like so: dzone_style = '2'. Firefox is giving me a JavaScript error otherwise.

Nirav Thaker said...

Well, it's working on my Firefox (2.0.0.8) without quotes. Not sure why you're getting java script error (AFAIK technically since java script is typeless this can't be a java-script error, not all that sure though)

Pointless Researcher said...

Thank you, very useful. I added it to my blog (http://internna.blogspot.com) and looks great.

Shefali K. said...

Voting links for Wordpress? Let me take a look, I doubt it has.

Nirav Thaker said...

That voting is from and for DZone.com which is a site for developer links.

Sushant Sirsikar said...

Nice information. I used it in my blog.

jlorenzen said...
This comment has been removed by the author.
jlorenzen said...

according to this article you must first check Expand Widget Templates to see
<data:post.body/>

http://woork.blogspot.com/2007/10/add-digg-vote-button-on-blogger.html

jlorenzen said...

I also had to add an additional ending div tag at the end.

Nirav Thaker said...

Thanks jlorenze, I corrected it.

srinip said...

Hi Nirav,
Great post. Very useful for all the bloggers on the "blogger" site. I just added to my blog (http://srinip2007.blogspot.com).

Javin @ Tibco RV Tutorial said...

Thanks buddy , I have added this on my blog now.

Javin
Difference between FIX4.2 vs FIX4.4

Stapleton Denver said...

Already bookmarked and used it my blog, very wonderful piece of information. Thanks for the update!

Amanda Thomas said...

Many company businesses are using this kind of security and system process, to help them protect the data they've got. This is quite the trend right now, especially to those companies who have their own sites online.