You can do it with a global - this is for the new links in a category:
sub {
my $id=shift;
my $cattable=$DB->table('Links','CatLinks');
$cattable->select_options('ORDER BY Add_Date DESC','LIMIT 10');
my $sth = $cattable->select({CategoryID=>$id},VIEWABLE);
my @loop;
while (my $hit = $sth->fetchrow_hashref()) {
push @loop, $hit;
}
return {Links_Loop=>\@loop};
}
This is another global for general info about the category (optional I think):
sub {
my $id=shift;
my $table = $DB->table('Category');
my $link = $table->select({ID=>$id})->fetchrow_hashref;
return {%$link};
}
Then a new template something like this (please feel free to make comments on this as I'm not an rss expert)
<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0">
<%get_cat_info($ID)~%>
<%get_catlinks($ID)~%>
<%set pubdate=$Links_Loop.0.Add_Date~%>
<channel>
<title>New Sites in <%Name%> on <%site_title%></title>
<description>This is a feed of the latest listings in <%Name%> on <%site_title%></description>
<link>http://www.yourdomain.com/cgi-bin/page.cgi?p=newtemplatename</link>
<pubDate><%GT::Date::date_transform($pubdate,"%yyyy%-%mm%-%dd%","%ddd%, %dd% %mmm% %yyyy% %hh%:%MM%:%ss% GMT")%></pubDate>
<image>
<url>http://www.yourdomain.com/logo.jpg</url>
<title><%site_title%></title>
<link>http://www.yourdomain.com/cgi-bin/page.cgi?p=newtemplatename</link>
<description>Description of your site</description>
<width>100</width>
<height>60</height>
</image>
<%loop Links_Loop%>
<item>
<title><%escape_html Title%></title>
<description><%escape_html Description%></description>
<link>http://www.link.to.detailed.page</link>
<guid isPermaLink="true">http://www.link.to.detailed.page</guid>
<pubDate><%GT::Date::date_transform($Add_Date,"%yyyy%-%mm%-%dd%","%ddd%, %dd% %mmm% %yyyy% %hh%:%MM%:%ss% GMT")%></pubDate>
</item>
<%endloop%>
</channel>
</rss>