Adding "Share on EdBloggerNews" link to your Blogger Published 2006-09-11

As Dave Warlick and others have reminded us, Will Richardson has setup a fantastic resource for all of us who love to read (and write) EduBlog posts but are finding it difficult to read all of the articles in our RSS feeds. Take a look at EdBloggerNews, which is similar to Digg but for Education Blog posts.

Recently, Chris over at Open Source Classroom, posted a pluggin for Wordpress users who want to add a "Share on EdBloggerNews" link at the end of each of their posts.

I have taken Chris' lead and offer the following for uses of Blogger.

To have the link automatically added to each of your posts, you will need to edit the blog's template.

Step #1: Make a backup of your current template. It is always a good practice to copy the current template into a file on your computer in case you need to revert back to the "Last Known Good" version of the template.

Step #2: Add a script section in the <head> of your template. Notice that this script is relatively simple (one function) that opens a new window.

<script type="text/javascript">
function ToEdBloggerNews(title, permalink) {
 // constants
 const winAKA = "EdBloggerNews";
 const baseurl = http://edbloggernews.crispynews.com/article/new_edit'
 const windowSettings = 'toolbar=1,scrollbars=1,location=1,statusbar=0, »
menubar=1,resizable=1,width=800,height=700,left=0,top=0';
 
 // setup the url
 var url = baseurl + '?link=' + encodeURIComponent(permalink) + »
 '&title=' + encodeURIComponent(title) + '&pop=yes';
 
 // open the window and give it focus
 var w = window.open(url, winAKA, windowSettings);
 w.focus();
}
</script>

view code

Step #3: Add the following code to your template where ever you want the link to be (usually right after the <$BlogItemBody$> blogger tag).

<div class="edbloggernews">
<a href="<$BlogItemPermalinkUrl$>" »
onclick="ToEdBloggerNews('<$BlogItemTitle$>','<$BlogItemPermalinkUrl$>'); »
return false;" target="EdBloggerNews" »
title="Post this article to EdBloggerNews"> »
Share on EdBloggerNews!</a>
 </div>

view code

Step #4: Save your template and re-index your blog.

Notes: I included a class "edbloggernews" for the DIV tag that surrounds the link so that I can control the appearance of the link in my CSS.  This is optional.

Hope this helps and if you have any improvements (or questions) please let me know.

Tags: , ,

Powered by Qumana

1 comments:

rob banning said...

Found a bug... If you include quotes (double or single) in your title, then the link runs into trouble (i.e. it crashes).

I will look into a solution, but if anyone can suggest one, that would be great!

ROB