Feed Menus

When feeds became popular, it worked to have one icon on your site to point your readers to your RSS or Atom feeds. As feeds are more prevalent in blogs and websites abroad, the presence of multiple feeds abound. I have a feed for my blog, the nerdlab, my bookmarks, my friend feed as well as my twitter updates. That’s a butt-ton of feeds.

Browsers have come up with a smart way of offering this content to users and it is usually place somewhere by the location bar as shown below:

Firefox 3 Feed Menu

Firefox 3 Feed Menu

Safari 3 Feed Menu

Safari 3 Feed Menu

With the click of a button, you can view all of the feeds available in the <head> of the document.

But still, it’s nice to offer users an alternate way to get at your feeds, so typically you will see a feed icon lurking around a site somewhere. At times, you will see a list of two, three or more links to different feeds offered on a site. Why not have an easy and standard way of offering your feeds via a nice, compact menu, just like in the location bar, but on your site? Why I ask? Why?

It’d be awesome to allow users to click your feed icon and be presented with a list of feeds to choose from. Hmmm, I want your twitter feed in Atom format or I’d like to subscribe to your blog feed in RSS format. Done.

The jQuery Feed Menu

Here’s how easy it is. I am going to plop one right here: . Go ahead click it. You know you want to. This feed menu was created easily by the following snippet of code:

var fm = new FeedMenu();
fm.write('#jquery_feed_menu_example_1');

Cool huh? That piece of code finds all of your feeds in the <head> of your HTML document and makes them into a handy menu you can plop anywhere. Here are some more examples:

Atom Feeds

Atom Feeds:

Code:

var fm = new FeedMenu('link[type*=atom]');
fm.write('#jquery_feed_menu_example_2');

RSS Feeds

RSS Feeds:

Code:

var fm = new FeedMenu('link[type*=rss]');
fm.write('#jquery_feed_menu_example_3');

Different Theme Classes:

Classic Orange
Komodo Media v.4 Woodgrain
Komodo Media Azure

Transparent on Dark (for dark backgrounds)

Transparent on Light (for light backgrounds)

Code:

/*
* @param 1: CSS link selector or array of JSON objects
* @param 2: Class Name: null, wood, azure, trans_on_dark, trans_on_light
/*
var fm = new FeedMenu(null,'wood'); //2nd param is class
fm.write('#jquery_feed_menu_example');

Last, something custom

Let’s say you don’t want the feed menu to find links for you. You want to provide them in code. Check this out:

And, here’s the custom code:

var oCustomLinks = [
{
title:'RSS Feed',
href:"http://feeds.feedburner.com/komodomedia"
},
{
title:'Subscribe with Bloglines',
href:"http://www.bloglines.com/sub/http://feeds.feedburner.com/komodomedia"
},
{
title:'Subscribe with Google Reader',
href:"http://www.google.com/reader/view/feed/http://feeds.feedburner.com/komodomedia"
}
];
var fm = new FeedMenu(oCustomLinks);
fm.write('#jquery_feed_menu_example_6');

You can download all of the files used here to use on your site. Feel free to modify and use this code how you see fit and if you use it, please drop a comment here to show me how you’ve used it.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Comments

42 Comments

  1. Grant Palin said 1719 days ago

    Ooh, that is too clever! I do see sites that have numerous feeds, and have wondered how that might be presented nicely. I think this would be the solution.

  2. Daniel said 1719 days ago

    Awesome :D

  3. neondragon said 1719 days ago

    Priceless… I’ve already linked it on my tumblelog!

  4. Brendan Falkowski said 1719 days ago

    Nice idea, getting ahead of myself thinking of ways to style it.

  5. Tim said 1719 days ago

    Very nice idea. Especially love the graphics. Would be cool to have it fade in to. Great work!

  6. chazzuka said 1717 days ago

    awsome, worth to try it out :)

  7. Guillermo Rauch said 1717 days ago

    Excellent idea. Beautiful implementation!

  8. chuck said 1717 days ago

    Nice little solution, Rogie. Thanks.

  9. Amy said 1716 days ago

    Really cool, thanks for sharing!

  10. Rogie said 1714 days ago

    @everyone – Thanks all for the great and kind comments. Please let me know if you see any enhancements that can be done.

    Also, let me know if you have ported the code to other languages so that I can link you here.

  11. Wayde Christie said 1714 days ago

    Fantastic idea. Rather than a select box as your menu, it would be great if it were just a nested list – that way it could be styled however I see fit.

    Great work though – me steal!

  12. Vivekanand said 1714 days ago

    Great Idea, keep up the good work….. rock the web world.

  13. Larry Marburger said 1714 days ago

    Great idea, Rogie! Nice CSS and JavaScript ninjary.

  14. Rogie said 1714 days ago

    @Wayde – Yes, of course great idea. However, select lists work out of the box on the edges of your browser, meaning that I don’t need to code any JS to detect position in relation to the window to make the menu pop vertically upward. Another added benefit of select lists is that if they are near the right edge of the browser, the options will be visible over the browser.

    @Larry – thanks man. I dig ninjas…and JavaScript.

  15. Brian Feister said 1714 days ago

    this is some awesome insight …. so helpful! thanks man!

  16. Wayde Christie said 1714 days ago

    @Rogie – Another great tip! I hadn’t thought of that.

    Although I’m inclined to say “so what if the select box goes off the screen?” :)

    From my experience, the trade-off between struggling to style select boxes and just going with a list has always seen me going with a list.

    Anyway, when I get around to using your plugin, I’ll have a fiddle and see if I can add anything to it – will let you know if I do :)

    Thanks again!

  17. Rogie said 1714 days ago

    @Wayde – Styling the options will always be almost nonexistent, however, styling the actual select, icon and arrow is where you have some freedom. This plugin could easily be changed to create an unordered list with list items of feeds. Go for it!

    @Brian Feister – Thanks man.

  18. Rolando Murillo said 1712 days ago

    Awesome, incredible. I like that icons, congrats.

    Good luck, keep doing this kind of stuff.

  19. DarkWolf said 1711 days ago

    Wow, I love the buttons and it’s a very good ide.
    Thanks and keep it up! =)

  20. Nenad said 1710 days ago

    Awesome!

  21. Zodios said 1709 days ago

    Nice. But it has one small bug.

  22. Rogie said 1709 days ago

    @Zodios – What is that? It’d be nice to know about bugs so I can fix them…

  23. insic said 1708 days ago

    cool, this is brilliant! im thinking i have to use this in my site.

  24. Kimberly James said 1708 days ago

    I can’t figure out how to use this. If I am using the trans on dark then what code goes where?

  25. Rogie said 1707 days ago

    @Kimberly James – First, include the CSS and the JS found in the example in the head of your HTML document as a link and a script respectively.

    Next, you’ll need to put the following code in your document with an onload or an $(document).ready (in jQuery):

    var fm = new FeedMenu(null,'trans_on_dark');
    fm.write('css_selector');

    Where “css_selector” is a string containing the selector of the item you want the feed menu to be added to, i.e. #feed_menu_container.

  26. Kimberly James said 1707 days ago

    Thanks for writing back so fast. I feel like an idiot, because I don’t understand that either. lol. I understand to put the js and css where they need to be, but the rest I am clueless about.

  27. Joefrey Mahusay said 1707 days ago

    Really nice Feed menus. Very creative specially the komodo media wood feed.

  28. shubelal said 1706 days ago

    great Feed menus. its Very creative

    thanks

  29. Steve said 1706 days ago

    The dropdown is too narrow for the text in IE 7, but it’s OK in others.

    See http://k7waterfront.org/

    Any insight?

  30. Ryan Coughlin said 1703 days ago

    Wow…very very creative nice work and I love how you added the “komodo” theme in there. I am going to try this out on my new site. Great write up!

  31. backpack-smith said 1700 days ago

    Thank for the feed jquery code. Good job!

  32. archondigital said 1699 days ago

    Excellent work! Stumbled!

    I’ll be using this for another project of mine

  33. Philip Downer said 1696 days ago

    A perfectly crafted solution. Thanks! I’ve been looking for something like this for quite some time.

  34. mmm said 1685 days ago

    cbvbcv

  35. Brian said 1675 days ago

    Very nice, like the look of it..

  36. Omar said 1672 days ago

    thanks alot! helped me on my last project.

  37. Davi Ferreira said 1668 days ago

    Awesome, thanks :)

  38. fxencore said 1664 days ago

    Thanks for the code. I realy like this simple adding.

  39. Jacksonville Web Design said 1660 days ago

    Well done! This is a very cool system!
    JimS.
    Jacksonville, FL
    Go Gators!

  40. Chris W. said 1660 days ago

    This definitely doesn’t suck.

  41. Alex said 1650 days ago

    I like it so much. It’s easy to use. THX!

  42. Kasper Worm Andersson said 1649 days ago

    Great article.

    Might be using this on my website.

Sorry, the comment form is closed at this time.