Putting RSS/Atom feeds back

UPDATED: This is almost pointless now as we have added the feed buttons to both the real footer and mini-footer :)

If you want to remove the feeds use this code in your CSS:


#feeds {
     display: none;
}

When a pro adds a custom footer, the links to the RSS and Atom feeds are also nuked. I came up with some javascript that will put them back wherever they want them to be.

First, add the following code to the Javascript section of your customizing page:


function findFeed(feedType, feedImage) {
  linkTags = document.getElementsByTagName("link");
  for (i = 0; i < linkTags.length; i++) {
    if (linkTags[i].type == feedType) {
      document.write('<a href="'+linkTags[i].href+'"><img src="http://www.smugmug.com/img/'+feedImage+'.gif" border="0"/>< /a>');
    }
  }
}

Then, in any of your HTML sections, add this code and the buttons will appear:


<script type="text/javascript">
  findFeed("application/atom+xml","atom");
  findFeed("application/rss+xml","rss");
</script>

6 Responses to “Putting RSS/Atom feeds back”

  1. Nir Alon Says:

    Copied the Java section into my Javascript HTML section.
    Copied the HTML code into my footer HTML section.

    Doesn’t work! RSS buttons aren’t there and home page loads with error.

    I’d appreciate your assistance here.
    Thanks!

  2. Mike Lane Says:

    I have followed the directions like you said (js part in the js box, other part in the footer html box) and nothing…

    Hmmmm

  3. Administrator Says:

    There were some problems with the way that it was formatted for this site, I have updated the code and it now works.

  4. Mike Lane Says:

    I remembered that firefox automatically detects the rss and atom feeds and provides you with a link, so it’s a moot point for me now. That firefox trick may be of interest to people though.

  5. Nir Alon Says:

    Thanks for the fix! Works fine!

  6. Ben Says:

    Is there a way to disable these for Power users? thanks.

Leave a Reply