DEV Community

Discussion on: Bypassing property editor restrictions in Umbraco Element Types

Collapse
 
dgibbs profile image
Duane Gibbs

I couldn't get this to work in v11, it seems something has changed with how the property editor configuration is parsed.

The base TagsValueConverter expects the editor configuration to be an instance of TagConfiguration however you get a Dictionary<string, object> using a package.manifest with 'prevalues' approach. This results in an invalid cast exception in the base class when trying to figure out what storage type has been used.

The workaround is to register the 'Data only' tags editor via C# class by inheriting from TagsPropertyEditor.

e.g:

[DataEditor("Umbraco.Tags.DataOnly", "Tags", "tags", Icon = "icon-tags", ValueEditorIsReusable = true)]
public class TagsDataOnlyEditor : TagsPropertyEditor { //... }

The base TagsPropertyEditor ensures the configuration object is created in the correct format.