Wednesday, March 21, 2012

How to create RSS in ektron CMS

Here i will show how to create a RSS for collection data in Ektron cms.In ektron cms we have an option ecmRssCollection method to get the data to rss feed object.There one more server control i:e RSSagrregator is also used to ge the rss feed data.I have collection control in my results page.When ever click on the Rss feed the query string value is passed to the rss page .The rss page shouldn't have HTML content.By default the aspx page has HTML content so we have to remove the content in this page.If we don't remove the html content in page we not get the rss data in Chrome browser.The 15 is the collection default ID in work area

if (Request.QueryString["rss"] == "collectionDatatest")
{
object rssFeedData = null;
Ektron.Cms.UI.CommonUI.ApplicationAPI AppCUI = new Ektron.Cms.UI.CommonUI.ApplicationAPI();
rssFeedData = AppCUI.ecmRssCollection(15)
Response.ContentType = "text/xml";
Response.Write(rssFeedData);
}

1 comment:

Anonymous said...

Thank you so much for this post, you saved me a lot of time! Also thanks for fully qualifying your AppCUI definition and for specifying that I had to remove the HTML code from my ASPX file.

I wanted to make an RSS feed for the top 20 items in my news folder, not for a pre-defined collection, so I had to change one line of code as follows:

rssFeedData = AppCUI.ecmRssSummary(105, false, "DateCreated,desc", 20);
// 105 = folderid, 20= number of items to show

Hope this helps someone!

Bel