I don't know if these 2 problems are related but i have having a problem with content not saving when i click save or save and publish on one of my page types called InsidePage. All my other templates work just great.
Here is my code for the InsidePage Template.
<?php
/**
* Defines the InsidePage page type
*/
class InsidePage extends Page {
static $db = array(
'Email' => 'Text',
'Phone' => 'Text',
'Location' => 'Text',
'Webstie' => 'Text',
'Twitter' => 'Text',
'Facebook' => 'Text',
'Flickr' => 'Text',
'StudentDevelopment' => 'HTMLText',
'Sustainability' => 'HTMlText',
'Diversity' => 'HTMLText'
);
static $has_one = array (
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Contact', new TextField('Phone'));
$fields->addFieldToTab('Root.Content.Contact', new TextField('Email'));
$fields->addFieldToTab('Root.Content.Contact', new TextField('Location'));
$fields->addFieldToTab('Root.Content.Links', new TextField('Website'));
$fields->addFieldToTab('Root.Content.Links', new TextField('Twitter'));
$fields->addFieldToTab('Root.Content.Links', new TextField('Facebook'));
$fields->addFieldToTab('Root.Content.Links', new TextField('Flickr'));
$fields->addFieldToTab('Root.Content.StudentDevelopment', new HtmlEditorField("StudentDevelopment","GreyboxContent"));
$fields->addFieldToTab('Root.Content.Sustainability', new HtmlEditorField("Sustainability","GreyboxContent"));
$fields->addFieldToTab('Root.Content.Diversity', new HtmlEditorField("Diversity","GreyboxContent"));
return $fields;
}
}
class InsidePage_Controller extends Page_Controller {
}
?>
I think the problem is happening when i add the HtmlEditorFields to the CMS because when I comment out those lines run a dev/build and reload the admin everything works just great. could someone help me with this?
/**
$fields->addFieldToTab('Root.Content.StudentDevelopment', new HtmlEditorField("StudentDevelopment","GreyboxContent"));
$fields->addFieldToTab('Root.Content.Sustainability', new HtmlEditorField("Sustainability","GreyboxContent"));
$fields->addFieldToTab('Root.Content.Diversity', new HtmlEditorField("Diversity","GreyboxContent"));
**/