[ic] RSS feeds with IC
Joshua Lavin
joshua at kingdomdesign.com
Mon Apr 5 15:08:41 EDT 2004
Hey everyone,
This is something new I'm trying, and I thought it'd be fun to share. I
wanted to get an RSS feed of what's new on our site, but this could be
used for any list.
I created a new page in [catroot]/pages, called 'rss.xml.html', with
the code below (although I don't think it needs the second line). It is
pulled up without the html extension, so
http://shopalert.us/shop/rss.xml gets the feed. (Note that some fields
here are not IC defaults.)
[set mv_add_do_html]0[/set]
[calc] $Config->{HTMLsuffix} = '.xml'; return[/calc]
[tag op=header]Content-type: text/xml[/tag]
<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>ShopALERT What's New</title>
<link>http://www.shopalert.us/shop/whatsnew.html</link>
<description>ShopALERT: Newest Items Added</description>
<language>en</language>
<copyright>Copyright 2004 ALERT</copyright>
<lastBuildDate>[time]%a, %d %b %Y %H:%M:%S %Z[/time]</lastBuildDate>
<generator>Interchange</generator>
<webMaster>sum at gui.com</webMaster>
[query sql="select SKUID, FullDescription, Department, Category,
RetailPrice, SKUPicText from products order by SKUID desc limit 15"
table=products type=list]
[list]
<item>
<title>[sql-field FullDescription]</title>
<link>http://www.shopalert.us/shop/[sql-code].html</link>
<description><![CDATA[<strong>[sql-field Department]:
[sql-field Category]</strong><br /><br />
[sql-field SKUPicText]<br /><br />
[sql-price]]]></description>
</item>
[/list]
[/query]
</channel>
</rss>
Enjoy!
--
Josh Lavin
Kingdom Design http://www.kdw.us/
More information about the interchange-users
mailing list