This document contains information for an outdated version and may not be maintained any more. If some of your projects still use this version, consider upgrading as soon as possible.


The Versioned class is a DataObject that adds versioning and staging capabilities to the objects.

Trapping the publication event

Sometimes, you'll want to do something whenever a particular kind of page is published. This example sends an email whenever a blog entry has been published.

class Page extends SiteTree {
  // ...
  function onAfterPublish() {
    mail("", "Blog published", "The blog has been published");

Was this article helpful?