> Has anyone used Radiant to produce Atom feeds? If so what 
> code did you use?

I've got a Page type that exposes all the data needed for an atom feed.

http://soxbox.no-ip.org/radiant/svn/extensions/x_groggy/app/models/atom_page.rb

There's a few hard-coded things in there - Specifically in the 'atom' tag 
(choosing the pages to display) and atom:url tag (how do
you get the full url of a page including host?)

One thing to note is the updated_at (calculated in atom:each) - you can't have 
two pages with exactly the same updated time under
atom (which is a weird restriction if you ask me) - I make sure to keep an eye 
on that and adjust if necessary (it bit me when I did
an automated update from my old system).

This is the actual content of the page. Note that you'd probably want to serve 
up your content escaped, but I'm fairly anal about
maintaining valid content on my pages, so I didn't bother with that.


<?xml version='1.0' encoding='UTF-8'?>
<r:atom>
<feed xmlns='http://www.w3.org/2005/Atom' xml:lang='en-us' xml:base='<r:url/>'>
 <title>The Groggy Squirrel</title>
 <id>http://www.thegroggysquirrel.com/</id>
 <link href='./' />
 <link rel='self' href='' />
 <!--
 <logo>rsslogo.jpg</logo>
 <icon>/favicon.ico</icon>
 -->
 <updated><r:feed_updated/></updated>
 <author><name>The Groggy Squirrel</name></author>
 <subtitle>The Groggy Squirrel is an online guide to comedy in Melbourne and 
across Australia</subtitle>
 <rights>All content copyright to their respective authors. All rights 
reserved.</rights>
 <!--
 <generator uri='generator uri'>generator description</generator>
 -->

<r:each>
<entry>
 <title><r:title/></title>
 <link href='<r:url/>' />
 <id><r:url/></id>
 <author><name><r:author/></name></author>
 <published><r:atom_published_date/></published>
 <updated><r:atom_updated_date/></updated>
<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
<r:content/>
</div></content></entry>
</r:each>
</feed>
</r:atom>
_______________________________________________
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to