Skip to content

Commit

Permalink
Use SiteDisplayDriver
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Aug 8, 2024
1 parent 877991a commit 1dd826e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Lombiq.TrainingDemo/Drivers/DemoSettingsDisplayDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ namespace Lombiq.TrainingDemo.Drivers;
// Now this display driver abstraction is different from the one you've seen before. In Orchard Core you can connect
// different objects to a master object that will be connected in the database when storing them. Site settings are
// handled this way.
public class DemoSettingsDisplayDriver : SectionDisplayDriver<ISite, DemoSettings>
public class DemoSettingsDisplayDriver : SiteDisplayDriver<DemoSettings>
{
// Since technically we have only one SiteSettings we have separate the editors using editor groups. It's a good
// idea to store the editor group ID in a publicly accessibly constant (would be much better to store it in a static
// class placed in a Constants folder).
public const string EditorGroupId = "Demo";

// This abstract property of SiteDisplayDriver has to be overridden. It is used to filter the editor by group name
// under the hood, so you don't have to check it manually.
protected override string SettingsGroupId => EditorGroupId;

private readonly IAuthorizationService _authorizationService;
private readonly IHttpContextAccessor _hca;

Expand Down

0 comments on commit 1dd826e

Please sign in to comment.