Set isMainPage to true on TemplateRenderer.ExecuteTemplateRendering (#10684)

* Set isMainPage to true on TemplateRenderer.ExecuteTemplateRendering (#10683)

* Added comment

* Tweak comment for clarity

Co-authored-by: Paul Johnson <pmj@umbraco.com>
This commit is contained in:
Laura Neto
2021-08-12 12:09:21 +02:00
committed by GitHub
parent 6085e03600
commit 7710409be8

View File

@@ -152,7 +152,8 @@ namespace Umbraco.Cms.Web.Common.Templates
{
var httpContext = _httpContextAccessor.GetRequiredHttpContext();
var viewResult = _viewEngine.GetView(null, $"~/Views/{request.GetTemplateAlias()}.cshtml", false);
// isMainPage is set to true here to ensure ViewStart(s) found in the view hierarchy are rendered
var viewResult = _viewEngine.GetView(null, $"~/Views/{request.GetTemplateAlias()}.cshtml", isMainPage: true);
if (viewResult.Success == false)
{