Version: current

     1 <?php
     2 /**
     3  * Defines the DocPage page type
     4  */
     5
     6 class DocPage extends MediawebPage {
     7     static $hide_ancestor = 'MediawebPage';
     8
     9
    10     function requireDefaultRecords() {
    11         parent::requireDefaultRecords();
    12
    13         if ($this->class != 'DocPage') return;
    14
    15         // default pages
    16         if($page = DataObject::get_by_id('Page', 2)) {
    17             if ($page->ClassName == 'Page') {
    18                 $page->ClassName = 'DocPage';
    19                 $page->URLSegment = 'about';
    20                 $page->populateDefaults();
    21                 $page->write();
    22                 $page->publish('Stage', 'Live');
    23                 $page->flushCache();
    24                 DB::alteration_message('About page updated', 'created');
    25             }
    26         }
    27     }
    28 }
    29
    30 class DocPage_Controller extends MediawebPage_Controller {
    31
    32
    33 }
    34

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -