![]() |
VOOZH | about |
dotnet add package KXB.Umbraco.UmbracoDictionaryExtension --version 1.1.1
NuGet\Install-Package KXB.Umbraco.UmbracoDictionaryExtension -Version 1.1.1
<PackageReference Include="KXB.Umbraco.UmbracoDictionaryExtension" Version="1.1.1" />
<PackageVersion Include="KXB.Umbraco.UmbracoDictionaryExtension" Version="1.1.1" />Directory.Packages.props
<PackageReference Include="KXB.Umbraco.UmbracoDictionaryExtension" />Project file
paket add KXB.Umbraco.UmbracoDictionaryExtension --version 1.1.1
#r "nuget: KXB.Umbraco.UmbracoDictionaryExtension, 1.1.1"
#:package KXB.Umbraco.UmbracoDictionaryExtension@1.1.1
#addin nuget:?package=KXB.Umbraco.UmbracoDictionaryExtension&version=1.1.1Install as a Cake Addin
#tool nuget:?package=KXB.Umbraco.UmbracoDictionaryExtension&version=1.1.1Install as a Cake Tool
An extension to the UmbracoHelper with several ease of life improvements
Using the new method Umbraco.GetDictionaryValueAndCreateDictionaryItem(string key, string fallback="") you can create dictionary items code first by simply requesting them in your code. It's no longer necessary to manually create the dictionary items under Umbraco → Settings.
"Folders" in the dictionary is created based on the name of the key, example:
The key "Foo.Bar.Key" will be placed in Dictionary → "Foo" → "Bar"
The method has 3 "creation modes":
The creation mode can be set by modifying the app.config key: "KXB.Umbraco.UmbracoDictionaryExtension.CreationMode"
Using Umbraco.GetDictionaryItemsForPrefix(string prefix) or GetDictionaryValuesForPrefix(string prefix) you can retrieve dictionary values for a given prefix.
Example:
Umbraco.GetDictionaryItemsForPrefix("Foo.") could return dictionary items with the following keys:
etc
App config keys and their usage: XB.Umbraco.UmbracoDictionaryExtension.CreationMode" determines what values is stored in newly created keys. Valid options are "key" (default), "fallback", "empty" "KXB.Umbraco.UmbracoDictionaryExtension.SeparationSymbol" determines which symbol is used to separate "folders" in the names of dictionary keys. Default value is "."
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net452 net452 is compatible. net46 net46 was computed. net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
Changed default value of "KXB.Umbraco.UmbracoDictionaryExtension.SeparationSymbol" to "." (period).