Replies: 1 comment 2 replies
-
|
@abjerner Thank you for the suggestion, I'll give it some thought. In the meantime, I'm curious what the breaking-change be? As for v14+, I haven't tried out the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @leekelleher
For an Umbraco 13 project I'm working on, I'm creating and updating data types via C#.
One of them is the social links data editor, and I realized that setting the configuration is not all that friendly as it isn't backed by a C# type. So as you do in those situations, I ended up creating my own classes, and then converting it to the
Dictionary<string, object?>that Umbraco expects.With a bit of method chaining, that would then look something like this:
There would also be quivalent properties to initialize the configuration "the normal way".
Would you be interested in a PR for adding something like this directly to the package? Seeing as this would be a breaking change for current versions of Contentment, I had a quick play with this for v6, which made me question how to even set the configuration on an
IDataTypein Umbraco 14 (and whether theSocialLinksConfigurationclass even makes sense).IDataTypenow has theConfigurationDataandConfigurationObject- which are readonly.DataType(the class) has aSetConfigurationDatamethod, which let's you set the configuration from a dictionary, but not something similar for setting the configuration of an object. Am I missing something here? It used to be pretty simple in U13 and earlier.Beta Was this translation helpful? Give feedback.
All reactions