Cleanup of default template code

Moves it to the ViewHelper instead of inside of contenttypecontroller
This commit is contained in:
Per Ploug
2015-12-30 09:56:09 +01:00
parent 074dfc7e29
commit 6763e93af3
2 changed files with 7 additions and 10 deletions

View File

@@ -66,7 +66,7 @@ namespace Umbraco.Core.IO
return viewContent;
}
internal static string GetDefaultFileContent(string layoutPageAlias = null)
internal static string GetDefaultFileContent(string layoutPageAlias = null, string modelClassName = null)
{
var design = @"@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
@@ -76,6 +76,10 @@ namespace Umbraco.Core.IO
if (layoutPageAlias.IsNullOrWhiteSpace() == false)
design = design.Replace("null", string.Format("\"{0}.cshtml\"", layoutPageAlias));
if (modelClassName.IsNullOrWhiteSpace() == false)
design = design.Replace(".UmbracoTemplatePage", string.Format(".UmbracoTemplatePage<{0}>", modelClassName));
return design;
}