✄codebook

a cut&paste code archive

Dynamic External Link Section Embedding for your Blog! (or site...)

26/02/09 02:08 PM

Credits

  1. del.icio.us for their useful and innovative service!
  2. del.icio.us’s helpful Link Rolls feature.

Scenario

You use del.icio.us bookmarks religiously (like me)

You have a blog (or site) which has a links section that you update pretty often because you keep finding new people to link!

You want the links section of your blog/site to correspond to a certain group of bookmarks on your del.icio.us so that:

  • everytime you see a blog/site that you want to link, you can simply add it to your del.icio.us with the specific tag that will make it show up on your blog sidebar / site links list
  • you don’t need to go into editing your blog template / site html to update your links!

Solution

step1

Organise your del.icio.us bookmarks to add a special tag for the sites you want to link. e.g. append a new tag bloglinks to all the links you want to appear on your blog sidebar.

step2

Go to del.icio.us’s Link Rolls page page and at the bottom you should see settings for you to customise your widget.

Under the field Tags (optional), type in bloglinks or whatever special tag you appended in step 1.

You may also add a title, choose the sorting… etc.

When you are done, you should have a piece of code looking somewhat like this:
<script type="text/javascript" src="http://feeds.delicious.com/v2/js/XXXXX/ bloglinks ?title=MyBlogLinks&count=100&sort=alpha"></script>

where XXXXX is your del.icio.us username.

This code will display all your bookmarks tagged with bloglinks.

To specify additional tag filters, do not rely on typing in things like blog+fashion+link into the Tags (optional) field in del.icio.us’s link rolls page. Because the +’s will be converted to %2B in the generated javascript code, like this:
http://feeds.../js/XXXXX/blog %2B fashion %2B link
which will break your code when you actually want it to be:
http://feeds.../js/XXXXX/blog + fashion + link
so, to specify 2 or more tags, please edit the javascript code manually.

step3

Copy and paste the code given to you by del.icio.us link rolls into the portion of your blog/site template and publish.

Taa-daa! Now all bookmarks tagged bloglinks will appear on your sidebar! Let me know if you have found this useful!

Tags: JavaScript Tips&Tricks


Comment