Hi
I have added a checkbox to the admin area which allows the adminstrator to indicate whether they want a section of a page to be displayed or not.
class Page extends SiteTree {
static $db = array(
);
...,
'ContactUsValue' => 'Boolean',
...
);
function getCMSFields() {
$fields = parent::getCMSFields();
..
$fields->addFieldToTab("Root.Content.Main", new CheckboxField ('ContactUsValue', 'Contact Us link?'), Content);
...
return $fields;
}
}
Clicking the checkbox reveals the section. The problem occurs when they decide they want to remove it again. When they return to the page in question the checkbox doesn't display a tick and checking, then unchecking and saving does not change the flag. Any ideas?
Thanks
MM