I've got the following situation. There is a DocumentType which only 1 node can have. If the user tries to create it again I want to cancel the creation. This is currently not possible since there is no BeforeNew event. Is there another way to do this? Currently I can delete it in the AfterNew event, but that doesn't seem like the best way to do it.
P.S. The node can be copied so I can't remove it from the structure after it's created for 1 time.
Ok it's seems there is an before new event after looking at the source code. Document.Newing is called before the document is created. Looks like Umbraco v5 needs some better name convention...
Newing is the correct naming convention for an event, not prefixing with Before or After and unfortunately the mistake was made which resulted in inconsistent naming of the event.
v5 (assuming it has this style of eventing system) will use proper .NET standards for naming.
No Document.BeforeNew event?
Hello,
I've got the following situation. There is a DocumentType which only 1 node can have. If the user tries to create it again I want to cancel the creation. This is currently not possible since there is no BeforeNew event. Is there another way to do this? Currently I can delete it in the AfterNew event, but that doesn't seem like the best way to do it.
P.S. The node can be copied so I can't remove it from the structure after it's created for 1 time.
Jeroen
Ok it's seems there is an before new event after looking at the source code. Document.Newing is called before the document is created. Looks like Umbraco v5 needs some better name convention...
Jeroen
Newing is the correct naming convention for an event, not prefixing with Before or After and unfortunately the mistake was made which resulted in inconsistent naming of the event.
v5 (assuming it has this style of eventing system) will use proper .NET standards for naming.
is working on a reply...