andrewmckaskill
07/05/2023, 4:32 PMSendingContentNotification
to tweak the values. Is that still the preferred approach?
The issue we're having is that the data in the ContentNullable
field which we are supposed to use now is an anonymous datatype that we can't cast or use reflection on easily, where the Configuration
field was a nicely typed ValueListConfiguration
.
If there is a doc page or blog post someone can point me to of the "current" way of doing this that would be helpful.andrewmckaskill
07/07/2023, 8:41 AMandrewmckaskill
07/07/2023, 8:43 AMandrewmckaskill
07/07/2023, 8:44 AMleekelleher
07/07/2023, 8:50 AMIContentmentContentContext
which can be injected, this has a method .GetCurrentContent(out bool isParent)
... is isParent
is true, it could be assumed that it's a newly/unsaved document. (It's also true
for Block List items too though, 🤔 )
https://github.com/leekelleher/umbraco-contentment/blob/develop/docs/editors/data-list.md#accessing-contextual-content
Hope this helps.andrewmckaskill
07/07/2023, 8:54 AMandrewmckaskill
07/07/2023, 8:55 AMandrewmckaskill
07/07/2023, 8:55 AMvar home = _contentmentContentContext.GetCurrentContent(out bool isParent)?.Ancestor<Home>();
andrewmckaskill
07/07/2023, 8:56 AMGetCurrentContent
returns NULL for a NEW itemandrewmckaskill
07/07/2023, 8:56 AMandrewmckaskill
07/07/2023, 9:09 AMGetCurrentContent
method returns null.andrewmckaskill
07/07/2023, 9:10 AMleekelleher
07/07/2023, 9:25 AM