ContentService.Created in vNext?

,

In v8 we’ve got an event for ContentService.Created.
I can’t find it in vNext as a ContentNotification though, specificly v12 that i’m working with ATM.

Is it suppose to be there? Can I find it somewhere else?
Cheers’

Hi Anders,

If I remember correctly, you’ll want to use either the ContentSavingNotification or the ContentSavedNotification and check if the Id is 0 (indicating a new content item).

Hi,

you can use the ContentSaving and ContentSaved notifications and then check if the id has been updated.

1 Like

Ok,

Well we inherit loads of property data from ancestors on create. That the editor can edit straight away. I need to figure out another solution.

That said, if we create a blank node, waiting fo the saving/saved event to populate, we’re way to late.

Hi,

You might need the EditorModel Notifications then - which are before the content is sent to the backoffice.

but note : these do not exist on v14+ (see ongoing discussion)

@markusjoha is on it!
We’ve figured it out, will post a solution shortly :slight_smile:

… everyone should have a MVP two meters to their right.

I’m working with @andersbrohall on this.

Checked the source of v7, v8, and vNext and it seems like v7 and v8 had a way to hook into this on the service level:

v7:

v8

This disappeared in vNext.

The SendingContentNotification can indeed be used, however, it would only work when content is created from the backoffice and it also operates on the “view model” (ContentItemDisplay).

Maybe I should submit an issue in the Github-repo?

Update:
The use case here is to copy data from one node (IContent) into the newly created node so it’s populated when the editor starts to work on the node. I got it to work for property editors that work with strings and also for the Block Grid Editor - might be that we’re missing some code from potential DataEditors that processes the the raw data from IContent into the format in ContentItemDisplay - it works for our use case but it for sure feels like a real hack :pick:

Created this issue: Bring back Creating notification for Content · Issue #18716 · umbraco/Umbraco-CMS · GitHub

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.