Hi All,
I am trying to implement an image field for a cusatom page type. This is what I have in my class that extends Page.
static $db = array(
'Subtitle' => 'Text',
'TitleImage' => 'ImageField',
);
static $has_one = array(
);
/* admin icon */
static $icon = 'themes/bayer/images/treeicons/folder-blue';
/* allowed child page types */
static $allowed_children = array('');
function getCMSFields() {
$fields = parent::getCMSFields();
/**/
// Remove fields
/**/
//$fields->removeFieldFromTab("Root.Content.Main","Content");
$fields->removeFieldFromTab("Root.Content.Main","Excerpt");
$fields->removeFieldFromTab("Root.Content.Main","isNew");
$fields->removeFieldFromTab("Root.Content.Main","ArticleDate");
$fields->removeFieldFromTab("Root.Content.Main","lastEditDate");
$fields->removeFieldFromTab("Root.Content.Main","isNewTimeoutDate");
$fields->removeFieldFromTab("Root.Content.Main","featurePage");
$fields->removeFieldFromTab("Root.Content.Main","featurePageProblemSec");
$fields->removeFieldFromTab("Root.Content.Main","bgMark");
$fields->removeFieldFromTab("Root.Content.Main","moreLink");
// $fields->removeFieldFromTab("Root.Content.Main","MenuTitle");
/**/
// Add
$fields->addFieldToTab('Root.Content.Main', new TextField('Subtitle', 'Page subtitle (right under main title)'), 'MenuTitle');
$fields->addFieldToTab('Root.Content.Main', new ImageField('TitleImage', 'Page title image (top right corner)', null, null, null, "Fungicide"), 'MenuTitle');
}
When I go to the admin side and try to edit a page using this page type, I get errors!! I get the popup error with an SQL statement issue.
Any ideas!?
I'm stuck on SS 2.4.5 as I have in herited this project and upgrading it out of scope! :(
Any help very much appreciated,
K...