-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split composers that add views if people only use the core package (#224
- Loading branch information
1 parent
b2e05aa
commit 9e357d6
Showing
5 changed files
with
80 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Microsoft.Extensions.Configuration; | ||
using SeoToolkit.Umbraco.Common.Core.Collections; | ||
using SeoToolkit.Umbraco.Common.Core.Constants; | ||
using SeoToolkit.Umbraco.MetaFields.Core.Collections; | ||
using SeoToolkit.Umbraco.MetaFields.Core.Common.DisplayProviders; | ||
using SeoToolkit.Umbraco.MetaFields.Core.Common.SeoFieldGroups; | ||
using SeoToolkit.Umbraco.MetaFields.Core.Config.Models; | ||
using System; | ||
using System.Linq; | ||
using Umbraco.Cms.Core.Composing; | ||
using Umbraco.Cms.Core.DependencyInjection; | ||
|
||
namespace SeoToolkit.Umbraco.MetaFields | ||
{ | ||
internal class Composer : IComposer | ||
{ | ||
public void Compose(IUmbracoBuilder builder) | ||
{ | ||
var section = builder.Config.GetSection("SeoToolkit:MetaFields"); | ||
var settings = section?.Get<MetaFieldsAppSettingsModel>(); | ||
var disabledModules = settings?.DisabledModules ?? Array.Empty<string>(); | ||
|
||
if (!disabledModules.Contains(DisabledModuleConstant.DocumentTypeContextApp)) | ||
{ | ||
builder.WithCollectionBuilder<DisplayCollectionBuilder>() | ||
.Add<MetaFieldsDocumentSettingsDisplayProvider>(); | ||
|
||
builder.WithCollectionBuilder<SeoDisplayCollectionBuilder>() | ||
.Add<MetaFieldsContentDisplayProvider>(); | ||
|
||
builder.WithCollectionBuilder<SeoGroupCollectionBuilder>() | ||
.Append<MetaFieldsGroup>() | ||
.Append<OpenGraphFieldsGroup>() | ||
.Append<OthersFieldGroup>(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Microsoft.Extensions.Configuration; | ||
using SeoToolkit.Umbraco.Common.Core.Collections; | ||
using SeoToolkit.Umbraco.Common.Core.Constants; | ||
using SeoToolkit.Umbraco.Sitemap.Core.Common.DisplayProviders; | ||
using SeoToolkit.Umbraco.Sitemap.Core.Config.Models; | ||
using System; | ||
using System.Linq; | ||
using Umbraco.Cms.Core.Composing; | ||
using Umbraco.Cms.Core.DependencyInjection; | ||
|
||
namespace SeoToolkit.Umbraco.Sitemap | ||
{ | ||
internal class Composer : IComposer | ||
{ | ||
public void Compose(IUmbracoBuilder builder) | ||
{ | ||
var section = builder.Config.GetSection("SeoToolkit:Sitemap"); | ||
var disabledModules = section?.Get<SitemapAppSettingsModel>()?.DisabledModules ?? Array.Empty<string>(); | ||
|
||
if (!disabledModules.Contains(DisabledModuleConstant.DocumentTypeContextApp)) | ||
{ | ||
builder.WithCollectionBuilder<DisplayCollectionBuilder>() | ||
.Add<SitemapDocumentTypeDisplayProvider>(); | ||
} | ||
} | ||
} | ||
} |