Vettvangur.DictionaryHelper 1.0.5

Umbraco helper to fetch dictionary items

Install-Package Vettvangur.DictionaryHelper -Version 1.0.5
dotnet add package Vettvangur.DictionaryHelper --version 1.0.5
<PackageReference Include="Vettvangur.DictionaryHelper" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Vettvangur.DictionaryHelper --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Umbraco DictionaryHelper

All dictionary items are fetched and inserted into concurrency dictionary cache on start up and will be accessible with an extension on Umbraco helper.

Added value: Dictionary items can be created automaticly under specific parent key or by using namespacing to create a tree.

Available on Nuget

Click here to go to nuget project page

Example of usage with Umbraco helper:

Fetches the value of the dictionary item. Returns empty string if not found.
@using DictionaryHelper;

@Umbraco.DictionaryValue("key") //Fetches the value of the dictionary item. Returns empty string if not found.

Fetches the value of the dictionary item. Returns the default value if value is empty or key not found.
@Umbraco.DictionaryValue("key", "Default value")

Fetches the value of the dictionary item. Returns the default value if value is empty or key not found and will create the dictionary item with the default value if the key is not found.
@Umbraco.DictionaryValue("key", "Default value", null, true)

Creates the dictionary key if not found as a child on the parent key.
@Umbraco.DictionaryValue("key", "Default value", "parentKey", true)

Checks if any of the keys are existing and creates them if not found. With this approach the developer does not have to create the tree in the backoffice and its easy to know where the keys are located.
@Umbraco.DictionaryValue("root.child.key", "Default value", null, true)

Example of usage with service:

using DictionaryHelper;

@Service.GetValueByKeyAndCulture("key", "en-GB") 

Umbraco DictionaryHelper

All dictionary items are fetched and inserted into concurrency dictionary cache on start up and will be accessible with an extension on Umbraco helper.

Added value: Dictionary items can be created automaticly under specific parent key or by using namespacing to create a tree.

Available on Nuget

Click here to go to nuget project page

Example of usage with Umbraco helper:

Fetches the value of the dictionary item. Returns empty string if not found.
@using DictionaryHelper;

@Umbraco.DictionaryValue("key") //Fetches the value of the dictionary item. Returns empty string if not found.

Fetches the value of the dictionary item. Returns the default value if value is empty or key not found.
@Umbraco.DictionaryValue("key", "Default value")

Fetches the value of the dictionary item. Returns the default value if value is empty or key not found and will create the dictionary item with the default value if the key is not found.
@Umbraco.DictionaryValue("key", "Default value", null, true)

Creates the dictionary key if not found as a child on the parent key.
@Umbraco.DictionaryValue("key", "Default value", "parentKey", true)

Checks if any of the keys are existing and creates them if not found. With this approach the developer does not have to create the tree in the backoffice and its easy to know where the keys are located.
@Umbraco.DictionaryValue("root.child.key", "Default value", null, true)

Example of usage with service:

using DictionaryHelper;

@Service.GetValueByKeyAndCulture("key", "en-GB") 

Release Notes

New features to create dictionary items automaticly

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.5 7,369 12/22/2017
1.0.4 341 12/22/2017
1.0.3 281 12/22/2017
1.0.2 282 12/22/2017
1.0.1 269 12/22/2017
1.0.0 292 12/22/2017