Sean S. technique
(http://seansantry.com/development/articles/2006/12/15creating-an-atom-feed-in-radiant/)
is fine, but not quite right.
#1 - It uses the <r:date> tag for the updated field, but this tag only
displays the published_at date.
#2 - It uses the same id for every post, but the atom spec asks for a
unique id for each one.
I based my code on Sean’s, but with the proper corrections:
Layout:
<?xml version="1.0" encoding="utf-8"?> tag:uniaraxa.edu.br,: UNIARAXà : UNIARAXà http://www.uniaraxa.edu.br/ " title="UNIARAXà : " /> Radiant CMS Copyright 2002-2007, Centro Universitário do Planalto de AraxáUpdated part:
<r:find url=“/mediacenter/destaques/”><r:children:each limit=“1”
order=“desc” by=“updated_at”><r:updated format=“%Y-%m-%dT%H:%M:%SZ”
/></r:children:each></r:find>
Body part:
<r:find url=“/mediacenter/destaques/”>
<r:children:each limit=“10” order=“desc” by=“published_at”>
tag:uniaraxa.edu.br,<r:created format=“%Y-%m-%d”
/>:<r:parent><r:url /></r:parent><r:created format=“%Y%m%d%H%M%S”
/>
<r:title />
<r:updated format=“%Y-%m-%dT%H:%M:%SZ” />
<r:author />
</r:children:each>
</r:find>
This is not production code, just a quick test.
To solve problem #1 I created the <r:updated> tag, to show the date
and time the entry was updated, not published.
To solve problem #2 I followed the dive into mark tutorial
(http://diveintomark.org/archives/2004/05/28/howto-atom-id) and
created another tag <r:created>
The layout + page parts serves me best, because I have many different
feeds.
Last words:
The <r:updated> and <r:created> tags are just modified copies of the
<r:date> tag (quick test, remember?) so, it’s not the way to go. The
best aproach is to modify the <r:date> tag to accept another
paramenter to specify the date we want, for example:
<r:date =“created_at” />
<r:date =“updated_at” />
<r:date =“published_at” />
it would be nice to have this by default
Be Radiant!
Gabriel