Skip to content

Instantly share code, notes, and snippets.

@sleslie321
sleslie321 / rss.feed.cshtml
Created August 23, 2014 14:12
Create RSS Feed from Document Type in Umbraco using Razor
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{umbraco.library.ChangeContentType("text/xml");
var siteURL = "http://" + Request.Url.Host;
var HomePage = CurrentPage.AncestorOrSelf(1);
var RSSFeedPubDate = HomePage.Descendants("PressRelease").OrderBy("publishedDate desc").First();
}<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rssdatehelper="urn:rssdatehelper">