DictionaryType 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DictionaryType --version 1.0.0
NuGet\Install-Package DictionaryType -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DictionaryType" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DictionaryType --version 1.0.0
#r "nuget: DictionaryType, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DictionaryType as a Cake Addin
#addin nuget:?package=DictionaryType&version=1.0.0

// Install DictionaryType as a Cake Tool
#tool nuget:?package=DictionaryType&version=1.0.0

Dictionary Type

Umbraco DataType which values are based from dictionary items. An alternative for creating custom doctype as datasource for your dropdowns, checkbox list or radio buttons.

3 property editors

  1. Checkbox List
  2. Radio Buttons
  3. Dropdown

Installation

1. Umbraco package

Install from the developer section in Umbraco or download from the link below

https://our.umbraco.com/packages/backoffice-extensions/DictionaryType/

2. NuGet package

Install from NuGet package manager or run the following command in Visual Studio package manage console:

PM> Install-Package DictionaryType

Instructions

  1. Create a parent a dictionary item with it's children being the list items.
  2. Add the parent dictionary key name into the Parent Dictionary Key field in the Dictionary Property Editor.
  3. Add the created DataType into a DocumentType or MemberType and you'll have your child items as your choices in the list.

Using the dictionary list for other implementation

using DictionaryType.Foundation.Core.Helpers;
...
    
public class YourClass
{
    private readonly IDictionaryTypeHelper _dictionaryHelper;

    public YourClass(IDictionaryTypeHelper dictionaryHelper)
    {
        _dictionaryHelper = dictionaryHelper;
    }

    public List<SelectListItem> GetDictionaryList(string parentKey, string language = null)
    {
        var result = new List<SelectListItem>();

        //Get the dictionary list
        var dictionaryList = _dictionaryHelper.GetDictionaryList(parentKey, language);

        if (dictionaryList != null && dictionaryList.Any())
        {
            result.AddRange(dictionaryList.Select(x => new SelectListItem() { Value = x.Key, Text = x.Value }));

        }

        return result;

    }
}

Dictionary icon by https://icons8.com https://icons8.com/icons/set/dictionary

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 419 2/16/2021
1.0.0 581 5/23/2020

1.0.0 Initial release