@All, Thanks for sharing.
@Aaron, Did you got any solution to make this work with TreeMultiselectField custom page list?
my code is working great with "CheckboxSetField". But not working with TreeMultiselectField in case of custom page list "NewsPage".
My working Code with "CheckboxSetField":
------------------------------------------------------------
public static $many_many = array(
"FeaturedArticle"=>"NewsPage",
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$pageList = DataObject::get('NewsPage');
$f = parent::getCMSFields();
$f->addFieldsToTab("Root.Content.FeaturedArticle", array(
new CheckboxSetField("FeaturedArticle", "Choose a your featured article:", $pageList),
));
return $f;
}
------------------------------------------------------------
Though when I use "TreeMultiselectField " this with "SiteTree" it works.
working Code with SiteTree is :
public static $many_many = array(
"FeaturedArticle"=>"SiteTree",
);
public function getCMSFields() {
$f = parent::getCMSFields();
$f->addFieldsToTab("Root.Content.FeaturedArticle", array(
new TreeMultiSelectField("FeaturedArticle", "Choose a your featured article:", "SiteTree"),
));
}
Any idea why it is not working with "NewsPage" class in TreeMultiselectField ?