Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Filtering TreeMultiSelect Field

Go to End



Community Member, 545 Posts

30 May 2014 at 8:17am

Edited: 30/05/2014 8:17am

I'm using a TreeMultiSelctField to manage a $many_many relation. I'm trying to limit TreeMultiselectField to a certain Page class

$treeField = TreeMultiselectField::create("Communities","Communities","Community","ID","Title");

The above code returns the entire site tree and not just 'Commiunity' pages. Bellow is teh code for the realtions

class RMSBlogExtension extends DataExtension {

	private static $many_many = array(
		"Communities" => "Community"

class BlogCommunityExtension extends DataExtension {
	private static $belongs_many_many = array(
		"BlogEntries" => "BlogEntry"


Not sure if the issue is that they're both DataExtentions or if I'm doinf something else wrong