views:

217

answers:

4

My website has an Atom feed and I want to make it easier to subscribe to it. I see that many sites such as StackOverflow have the Atom icon in the location bar in Firefox 3. I haven't, however, been able to work out how.

I assume some HTML is needed - but what tags specify the the browser that a page has a feed?

A: 

You want to use a <link> tag, which must be placed in the <head> section of your html.

Like this:

<!-- ... -->
<head>
    <link rel="alternate" 
          type="application/atom+xml" 
          title="RSS" 
          href="/path/to/your/atom/feed" /> 
</head>
<!-- ... -->
Triptych
A: 

Add this inside <head>...</head>

<link rel="alternate" type="application/atom+xml" title="RSS" href="YOUR_FEED_URL" />

substitude YOUR_FEED_URL to your atom feed's url

Sikachu
+3  A: 

You want something like this (from this very StackOverflow question):

<link rel="alternate" 
      type="application/atom+xml" 
      title="RSS" 
      href="/feeds/question/440391" />
Dan Herbert
+6  A: 

While the code provided in (all!) the other answers is absolutely correct, I would recommend against giving your feed a title of "RSS" if the format used is actually Atom. RSS, of course, refers to an entirely separate format for feeds and syndication and there's enough confusion among the general population about what the differences are that I wouldn't suggest feeding the fire. :-)

Instead, give your feed a more descriptive title (such as "News feed", "Blog feed", "Comics", etc.) based on your content. Also, it is absolutely possible for you to include multiple feed links in the same page, if you have more than one type of content!

<link rel="alternate" type="application/atom+xml" title="News" href="/atom.xml?type=news" />
<link rel="alternate" type="application/atom+xml" title="Blog" href="/atom.xml?type=blog" />
<link rel="alternate" type="application/atom+xml" title="Comics" href="/atom.xml?type=comics" />
Ben Blank
Thank you for the information. And also thanks to the others who also provided good information. All works fine.