Created
September 7, 2012 11:29
-
-
Save willprice76/3665369 to your computer and use it in GitHub Desktop.
Pageless Tridion Content Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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