dawoe / OEmbed-Picker-Property-Editor

Property editor for Umbraco CMS to allow embedding 3rd party media like Youtube, Vimeo, ... outside of the rich text editor.
https://our.umbraco.org/projects/backoffice-extensions/oembed-picker-property-editor/
MIT License
10 stars 10 forks source link

Can't Create Data Type Through Code #4

Closed 0Neji closed 3 years ago

0Neji commented 4 years ago

I'm working on a project which needs to initialise various data types through code. I've been able to successfully do this with a handful of the core Umbraco property editors. For example, to create a Nested Content Data Type:

IDataEditor dataEditor = new NestedContentPropertyEditor(Logger, new System.Lazy<PropertyEditorCollection>());

dataType = new DataType(dataEditor, 1);

I'm attempting to do the same with this package but the classes are locked down using internal. As per the Umbraco editors, I'd expect to be able to create this the same way - would it be possible to change the classes to allow data types to be created in other projects?

I'd expect something along these lines to do the job once the changes have been made:

IDataEditor dataEditor = new OEmbedPickerDataEditor(Logger);

dataType = new DataType(dataEditor, 1);

dataType.Configuration = new OEmbedPickerConfiguration()
{
    AllowMultiple = false
};
dawoe commented 4 years ago

Hi @0Neji

Would love to see the use case where you need to create them in code.

But for making them public. I will accept a PR for that. I tend to keep most stuff internal when I don't see a need for making them public.

Apperently now there is a need to have them public.

Dave

dawoe commented 3 years ago

this is fixed and is already availabel in the latest beta. Will be part of the 4.2.0 release