I apologise if this is really obvious and a stupid question but I'm a little stumped. I'm trying to add a field that is only visible on one page so I am using an if statement in the getCMSFields function of my page.
My question is is this even possible? Will it be called, etc? The reason I ask is that my if statement doesn't work unless I change getCMSFields to getCMSFields_forPopup which causes a whole new set of problems.
Please help!
Thanks in advance.
P.S. I'm using SilverStripe 2.4.7.
if ($this->ClassName == 'Movies') {
$movies= DataObject::get('Movie');
if (! empty($stores)) {
$map = $movies->toDropdownMap('ID', 'Name');
$checkBox = new CheckboxSetField(
$name = "Moviess",
$title = "Select Movies",
$source = $map
);
$fieldset->push($checkBox);
}
}