November Happy Hour will be moved to Thursday December 5th.

RssProvider and x amount of list outputs

Vote:
 
using the RssProvider sample file to generate a rssfeed. i want in the .CS file to set the amount of 10 feed instead of showing all feeds. Any one done that and have some code examples to share? This is the code i´m using: private void WriteRssDocument() { XmlDocument doc = new XmlDocument(); XmlNode outerNode = doc.CreateElement("rss"); .... .... PageReference listingContainer = (PageReference)CurrentPage["ListingContainer"]; PageDataCollection children = GetChildren(listingContainer); .... .... foreach(PageData page in children) { XmlNode item = doc.CreateNode(XmlNodeType.Element,"item", null).Value 4; int itemCount = 4; for (int i=0;i < itemCount; i++) { XmlNode itemTitle = doc.CreateElement("title"); itemTitle.InnerText = page.PageName; item.AppendChild(itemTitle); XmlNode itemLink = doc.CreateElement("link"); itemLink.InnerText = EPiServer.Global.EPConfig.HostUrl + page.LinkURL; item.AppendChild(itemLink); XmlNode itemDescription = doc.CreateElement("description"); itemDescription.InnerText = ""; item.AppendChild(itemDescription); XmlNode itemCreated = doc.CreateElement("dc","date","http://purl.org/dc/elements/1.1/"); itemCreated.InnerText = page.Changed.ToString("yyyy-MM-dd"); item.AppendChild(itemCreated); channel.AppendChild(item); } } doc.Save(Response.OutputStream);
#17675
Jul 09, 2007 15:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.