Saturday, January 14, 2012

SlashDot Blogger integration that actually works!

You can add a badge or link to your Blogger to easily allow your readers to submit it to Slashdot for consideration; and once submitted, take them to the discussion.

Full description on how SlashDot badges work is here: http://slashdot.org/faq/badges.shtml

This is the actual code that you need in your template:

<script type="text/javascript">
slashdot_title="data:post.title";
slashdot_url="data:post.url";
</script>
<script src="http://slashdot.org/slashdot-it.js" type="text/javascript"></script>

To add the tag into your post template go to the Template tab under your Blogger accounts Customization section. Select "Edit HTML" and check the "Expand Widget Templates" check box. Scan the template until you find a line that looks something like "<p><data:post.body/></p>". That is where the Blogger templating engine inserts the body of your post.
I inserted my tag to appear directly below the body of my posts but you can play around with whatever position you like by using the "Preview" button. You’ll have to save the template to apply the changes when you are satisfied.

I tested the corrected code, and it’s working great!
The only probrem here is that title seems to be ignored, no idea why.
Source is correct, for some reason it is not passed to submit url page on SlashDot.

Submit this story to DotNetKicks