Merge pull request #5164 from kjac/v8-fix-navigation-partial-template

V8: Fix navigation partial view template
This commit is contained in:
Elitsa Marinovska
2019-04-12 10:00:39 +02:00
committed by GitHub

View File

@@ -1034,10 +1034,12 @@ namespace Umbraco.Core.Services.Implement
//strip the @inherits if it's there
snippetContent = StripPartialViewHeader(snippetContent);
//Update Model.Content. to be Model. when used as PartialView
//Update Model.Content to be Model when used as PartialView
if (partialViewType == PartialViewType.PartialView)
{
snippetContent = snippetContent.Replace("Model.Content.", "Model.");
snippetContent = snippetContent
.Replace("Model.Content.", "Model.")
.Replace("(Model.Content)", "(Model)");
}
var content = $"{partialViewHeader}{Environment.NewLine}{snippetContent}";