I have a very frustrating issue where Silverstripe won't properly create a custom page type in a section within the CMS.
When I select the page type from the dropdown and click "Go", nothing happens. However, when I refresh the page has been created. This only happens with the custom page type - if I try and create a regular page under the section, it works absolutely fine. The section doesn't have an $allowed_children array defined, so I can create anything within it.
I would really really appreciate some help with this - it's driving me nuts!!!! Code for the extended page type as below:
<?php
class ProductDetail extends Page {
static $db = array(
'Code' => 'Text',
'Price' => 'Currency',
'PriceDescription' => 'Text'
);
static $has_one = array(
'Photo' => 'Image'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('Code'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new CurrencyField('Price'), '');
$fields->addFieldToTab('Root.Content.Main', new TextField('PriceDescription'), '');
$fields->addFieldToTab("Root.Content.Photo", new ImageField('Photo'));
$fields->renameField("PriceDescription", "Price Description");
$fields->renameField("Content","Product Description");
return $fields;
}
}
class ProductDetail_Controller extends Page_Controller {
}
?>