Skip to content

Commit

Permalink
Merge pull request #12 from Kentico/fix/app-settings-usage
Browse files Browse the repository at this point in the history
Fix: App setting name
  • Loading branch information
fialafilip authored Mar 21, 2024
2 parents b1bef9a + 023b2ec commit 37d4092
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
18 changes: 10 additions & 8 deletions docs/Usage-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ For backwards compatibility all snippet types are allowed by default and user do
If you need to customize this you should configure the following section:

``` json
"xbyk.tagmanager.modules": [
"Kentico.VWO",
"Kentico.GoogleTagManager",
"Kentico.GoogleAnalytics4",
"Kentico.MicrosoftClarity",
"Kentico.Intercom",
"Kentico.CustomTag"
]
"CMSTagManager": {
"modules": [
"Kentico.VWO",
"Kentico.GoogleTagManager",
"Kentico.GoogleAnalytics4",
"Kentico.MicrosoftClarity",
"Kentico.Intercom",
"Kentico.Custom"
]
}
```

If any module is specified only the specified modules are included. If no module is specified or the section is not present all modules are included.
Expand Down
20 changes: 11 additions & 9 deletions examples/DancingGoat/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
"ConnectionStrings": {
"CMSConnectionString": ""
},
"xbyk.tagmanager.modules": [
"Kentico.VWO",
"Kentico.GoogleTagManager",
"Kentico.GoogleAnalytics4",
"Kentico.MicrosoftClarity",
"Kentico.Intercom",
"Kentico.Custom",
"Custom.DancingGoatSnippet"
]
"CMSTagManager": {
"modules": [
"Kentico.VWO",
"Kentico.GoogleTagManager",
"Kentico.GoogleAnalytics4",
"Kentico.MicrosoftClarity",
"Kentico.Intercom",
"Kentico.Custom",
"Custom.DancingGoatSnippet"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ internal static class SnippetFactoryStore
private static readonly Dictionary<string, ISnippetFactory> snippetFactories = [];
public static void AddSnippetFactory<TSnippetFactory>(IConfiguration configuration) where TSnippetFactory : ISnippetFactory, new()
{
const string section = "xbyk.tagmanager.modules";
const string section = "CMSTagManager";

var usedTagModuleSection = configuration.GetSection(section).GetChildren();
var usedTagModuleSection = configuration.GetSection(section).GetSection("modules").GetChildren();
var snippetFactory = new TSnippetFactory();
var settings = snippetFactory.CreateCodeSnippetSettings();
string configurationString = settings.TagAppSettingsName;
Expand Down

0 comments on commit 37d4092

Please sign in to comment.