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.

Customising the CMS /

Customizing the TreeMultiselectField in the CMS


Reply


668 Views

Avatar
copernicus

Community Member, 4 Posts

5 November 2010 at 4:41am

Edited: 05/11/2010 4:42am

In the admin I have as an option when you create a new item to let you choose which categories it belongs to through a TreeMultiselectField.

$treeMenu = new TreeMultiselectField('Categories', 'What categories does this belong in?', 'PortfolioCategory');

PortfolioCategory is a class that extends Page.

Now, when you click on the drop down to select a category, it just shows the entire site tree. Is there a way to customize it to say, only show Pages of type "PortfolioCategory"?

Also, is there a way to have an option in the drop down automatically selected by default? Ideally, when you click "Add New Item", the drop down is there and one of the options is already selected and cannot be unselected.