Hello All,
Silverstripe Ver: 3.6
I have created a page type file and uploaded it to my live site and when I run /dev/build?flush=1 I get 'This Page Isn't Working', not sure what I need to do so that I am able to get the page type in the admin, could someone please help?
Below is my DocumentPage.php file
<?php
/**
* Defines the Document Page page type
*/
class DocumentPage extends Page {
static $db = array(
'DocumentStrap' => 'Text',
'PageBoxTitle' => 'Text',
'MobRightBox' => 'Text'
);
static $has_one = array(
'WebRightBox' => 'Image'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new TextField('DocumentStrap', 'Web Strap'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('PageBoxTitle', 'Left Box Title'), 'Content');
$fields->addFieldToTab('Root.Main', new TextField('MobRightBox', 'Mobile Right Box'), 'Content');
$icon = new UploadField('WebRightBox', 'Web Right Box');
$icon->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
$icon->setConfig('allowedMaxFileNumber', 1);
$icon->setFolderName('Managed/IconImages');
$icon->setCanPreviewFolder(true);
$icon->setRightTitle("Displayed to the right of the title. <br />Displays in the box.");
$fields->addFieldToTab('Root.Main', $icon, "Content");
//$fields->addFieldToTab('Root.Main', new TextareaField('WebRightBox', 'Web Right Box'), 'Content');
return $fields;
}
}
class DocumentPage_Controller extends Page_Controller {
}
I have also put the site in Dev mode.