1 vote

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

 

Instructions

1. Create a parent 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

Screenshots

Package owner

Romeo Cadaoas

Romeo Cadaoas

Romeo has 104 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.6.x (100%)
Version 8.5.x (100%)
Version 8.4.x (100%)
Version 8.3.x (100%)
Version 8.2.x (100%)
Version 8.1.x (100%)
Version 8.0.x (100%)
Version 7.15.x (untested)
Version 7.14.x (untested)
Version 7.13.x (untested)
Version 7.12.x (untested)
Version 7.11.x (untested)
Version 7.10.x (untested)
Version 7.9.x (untested)
Version 7.8.x (untested)
Version 7.7.x (untested)
Version 7.6.x (untested)
Version 7.5.x (untested)
Version 7.4.x (untested)
Version 7.3.x (untested)
Version 7.2.x (untested)
Version 7.1.x (untested)
Version 7.0.x (untested)
Version 6.2.x (untested)

You must login before you can report on package compatibility.

Package Information

  • Package owner: Romeo Cadaoas
  • Created: 23/05/2020
  • Current version 1.0.0
  • .NET version 4.7.2
  • License MIT
  • Downloads on Our: 12
  • Downloads on NuGet: 69
  • Total downloads : 81