Replies: 4 comments 2 replies
-
@TRexStark Thank you for the suggestion, but default values is not something I'm looking to add to Contentment's property-editors. Although I'm frequently asked about this. The main reason being is that I don't see the property-editor or Data Type as the place to configure a default value, it should be done either at Content Type level or use a Content Template (blueprint). Personally, for the times where I have needed to add a default value, I've ended up hooking into the Ultimately, I believe this is a pattern that Umbraco core needs to solve, not at property-editor / Data Type level. |
Beta Was this translation helpful? Give feedback.
-
Thanks @leekelleher I agree with you. |
Beta Was this translation helpful? Give feedback.
-
In a situation where data is static it would be useful to be able to add an equally static default value to the configuration. Optionally of course. |
Beta Was this translation helpful? Give feedback.
-
@jesperordrup / @ault, apparently it's not as straight forward as it seems. I previously created a custom string DataType to do this, the problem is, when you set a default value that editors can change, once you update/change the doc type that holds this data type, the value reverts back to the default value, which means any changes the editor made would be overwritten by you. I haven't put any thoughts on how to prevent that yet. But will keep thinking. |
Beta Was this translation helpful? Give feedback.
-
Hi @leekelleher
A while ago I created a Custom Property for a string and a textarea that you can add default values to. Helps the content editor to have preset values when necessary.
Given Contentment is a rich featured Package, it'll only make sense to have this feature part of it.
Initially, I also had a toggle to make them read only, but after I discovered the Admin Only Property https://github.com/LottePitcher/umbraco-admin-only-property I didn't need the readonly feature so I wasn't using it in my projects anymore.
Would you be interested on a Pull Request or I can just send you the code?
The only thing I couldn't figure out is this:
If you already have a content node with these properties and have existing values, then if you edit the Document Type, the original default values overwrites the value in the content node if it has been changed by the editor - maybe I can leave that for you to tweak? Of course if you have interested in implementing this.
Beta Was this translation helpful? Give feedback.
All reactions