Skip to content

Instantly share code, notes, and snippets.

@willprice76
Created September 7, 2012 11:29
Show Gist options
  • Save willprice76/3665369 to your computer and use it in GitHub Desktop.
Save willprice76/3665369 to your computer and use it in GitHub Desktop.
Pageless Tridion Content Controller
public class DynamicContentController : Controller
{
public ActionResult Render(string url, string contentType)
{
string viewName = GetView(contentType, url);
XDocument content = (new TridionModel()).GetContent(contentType, url);
if (content != null)
{
return View(viewName, content);
}
else
{
return new HttpNotFoundResult();
}
}
private string GetView(string contentType, string url)
{
return "NewsDetail";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment