Replies: 1 comment 1 reply
-
@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.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
IDataType
in Umbraco 14 (and whether theSocialLinksConfiguration
class even makes sense).IDataType
now has theConfigurationData
andConfigurationObject
- which are readonly.DataType
(the class) has aSetConfigurationData
method, 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