in umbraco 6 we used the following code in custom routes to assume
umbraco context of a given page. Does anyone have a concise/better example of
how you're doing this in 7? thanks
We have a class inheriting from UmbracoControl that would
expose the following:
umbraco context in 7
hi
in umbraco 6 we used the following code in custom routes to assume umbraco context of a given page. Does anyone have a concise/better example of how you're doing this in 7? thanks
We have a class inheriting from UmbracoControl that would expose the following:
protected void RenderUmbracoContent(IPublishedContent content)
{
var model = new RenderModel(content, CultureInfo.CurrentUICulture);
//add an umbraco data token so the umbraco view engine executes
RouteData.DataTokens["umbraco"] = model;
HttpContext.Items["pageID"] = Convert.ToString(content.Id);
}
Hello,
Can't you do the same in Umbraco 7?
Jeroen
Yes, Im using the same in 7, just thought there might be a better way now :D
thanks
is working on a reply...