O'Reilly logo

Umbraco User's Guide by Paul Sterling, Nik Wahlberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

THE UMBRACO EVENT MODEL

The event model that Umbraco employs is great for interacting with content and media and intercepting or injecting actions into the workflow as Umbraco's node lifecycle is executed. Again, the aim of this book is to introduce you to the concepts and not delve into granular details. In short, having access to these event hooks provides you with the ability to add workflows and integrate third-party and a host of other applications.

Event Hooks

Every action in the Umbraco process is covered by the event model, which makes subscribing to any of these events with just a few lines of code possible. Table 12-1 lists all the available event hooks and in what context they are relevant. This is a listing of all the events that you can tap into. For more specific examples of when these are used, see the sample code in the “Event Samples” section.

TABLE 12-1: Event Hooks

EVENT CONTEXT EVENT NAME
Accessumbraco.cms.businesslogic.web.Access
  • BeforeSave
  • AfterSave
  • New
  • BeforeAddProtection
  • AfterAddProtection
  • BeforeRemoveProtection
  • AfterRemoveProtection
  • BeforeAddMemberShipRoleToDocument
  • AfterAddMemberShipRoleToDocument
  • BeforeRemoveMemberShipRoleToDocument
  • AfterRemoveMemberShipRoleToDocument
  • BeforeRemoveMembershipUserFromDocument
  • AfterRemoveMembershipUserFromDocument
  • BeforeAddMembershipUserToDocument
  • AfterAddMembershipUserToDocument
BaseTreeumbraco.cms.presentation.Trees.BaseTree
  • BeforeNodeRender
  • AfterNodeRender
CMSNodeumbraco.cms.businesslogic.CMSNode

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required