Skip to content

Commit c9b3845

Browse files
committed
Merge branch 'develop' into develop-v11
2 parents 0ea2681 + def3fef commit c9b3845

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.ViewEngines;
3+
using Microsoft.Extensions.Logging;
4+
using Umbraco.Cms.Core.Models;
5+
using Umbraco.Cms.Core.Web;
6+
using Umbraco.Cms.Web.Common.Controllers;
7+
8+
namespace Umbraco.Docs.Samples.Web.Controllers
9+
{
10+
public class DefaultController : RenderController
11+
{
12+
public DefaultController(ILogger<RenderController> logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor) : base(logger, compositeViewEngine, umbracoContextAccessor)
13+
{
14+
}
15+
16+
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
17+
public override IActionResult Index()
18+
{
19+
return CurrentTemplate(new ContentModel(CurrentPage));
20+
}
21+
22+
}
23+
}

Umbraco.Docs.Samples.Web/Notifications/SendingAllowedChildrenNotificationHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Umbraco.Docs.Samples.Web.Notifications
88
{
9+
// https://our.umbraco.com/documentation/Reference/Notifications/SendingAllowedChildrenNotification/
910
internal class SendingAllowedChildrenNotificationHandler : INotificationHandler<SendingAllowedChildrenNotification>
1011
{
1112
public void Handle(SendingAllowedChildrenNotification notification)

Umbraco.Docs.Samples.Web/Startup.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
using Umbraco.Docs.Samples.Web.RecurringHostedService;
1111
using Umbraco.Docs.Samples.Web.Stylesheets_Javascript;
1212
using Umbraco.Docs.Samples.Web.Tutorials;
13+
using Umbraco.Cms.Web.Website.Controllers;
14+
using Umbraco.Docs.Samples.Web.Controllers;
1315

1416
namespace Umbraco.Docs.Samples.Web
1517
{
@@ -55,6 +57,11 @@ public void ConfigureServices(IServiceCollection services)
5557
.AddTutorials()
5658
.Build();
5759
#pragma warning restore IDE0022 // Use expression body for methods
60+
61+
services.Configure<UmbracoRenderingDefaultsOptions>(c =>
62+
{
63+
c.DefaultControllerType = typeof(DefaultController);
64+
});
5865
}
5966

6067
/// <summary>

0 commit comments

Comments
 (0)