I am having a great deal of trouble in adding some HTMLText areas on my pages. Have read the tutorials and viewed the related Forum Topics, however, it still does not work with respect to no Tab appearing in the Admin Area. Any help would be greatly appreciated. The code I am using in mysite/code/Page.php is:
<?php
class Page extends SiteTree {
static $db = array(
'AboutContent' => 'HTMLText'
);
static $has_one = array(
);
}
class Page_Controller extends ContentController {
public function init() {
parent::init();
// Note: you should use SS template require tags inside your templates
// instead of putting Requirements calls here. However these are
// included so that our older themes still work
Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}
/**
* Site search form
*/
function SearchForm() {
$searchText = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : 'Search';
$fields = new FieldSet(
new TextField("Search", "", $searchText)
);
$actions = new FieldSet(
new FormAction('results', 'Search')
);
return new SearchForm($this, "SearchForm", $fields, $actions);
}
/**
* Process and render search results
*/
function results($data, $form){
$data = array(
'Results' => $form->getResults(),
'Query' => $form->getSearchQuery(),
'Title' => 'Search Results'
);
return $this->customise($data)->renderWith(array('Page_results', 'Page'));
}
/**
* Address Details
*/
function getCMSFields(){
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.About', new HtmlEditorField ( $name = "AboutContent", $title = "About" ), 'Content' );
return $fields;
}
}
?>
The code I am using in templates\Page.ss is:
<div id="about"><!-- about -->
$AboutContent
</div><!-- /about -->
I have run /db/build?flush=1 and tried many other variations of the code based on information from the forums and tutorials but having no joy. Any ideas on what the issue could be?