Fixes: U4-4682 Get EditorTemplates and DisplayTemplates working with RenderViewEngine

This commit is contained in:
Shannon
2014-04-22 13:03:47 +10:00
parent a88cb3f724
commit 7823609500

View File

@@ -92,25 +92,25 @@ namespace Umbraco.Web.Mvc
/// <param name="controllerContext"></param>
/// <param name="isPartial"></param>
/// <returns></returns>
private bool ShouldFindView(ControllerContext controllerContext, bool isPartial)
{
var umbracoToken = controllerContext.GetDataTokenInViewContextHierarchy("umbraco");
private bool ShouldFindView(ControllerContext controllerContext, bool isPartial)
{
var umbracoToken = controllerContext.GetDataTokenInViewContextHierarchy("umbraco");
//first check if we're rendering a partial view for the back office, or surface controller, etc...
//anything that is not IUmbracoRenderModel as this should only pertain to Umbraco views.
if (isPartial && umbracoToken is RenderModel)
{
return true;
}
//first check if we're rendering a partial view for the back office, or surface controller, etc...
//anything that is not IUmbracoRenderModel as this should only pertain to Umbraco views.
if (isPartial && ((umbracoToken is RenderModel) == false))
{
return true;
}
//only find views if we're rendering the umbraco front end
//only find views if we're rendering the umbraco front end
if (umbracoToken is RenderModel)
{
return true;
}
{
return true;
}
return false;
}
return false;
}
}
}