I'm trying to add a custom tab. I've added the code below to add the tab to Page.php and when I rebuild the db it drops all my info and gives me a default build.
<?php
class Page extends SiteTree {
static $db = array(
"AnnouncementContent" => "Text",
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('AnnouncementContent'), 'Content');
return $fields;
}
static $has_one = array(
);
}
class Page_Controller extends ContentController {
function init() {
parent::init();
Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}
}
?>
At this point wouldn't the added code just add the field in the CMS? Why is it dropping my db?