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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Populating The TreeDropdownField or TreeMultiselectField With Categories


Go to End


2158 Views

Avatar
davede

Community Member, 24 Posts

20 August 2011 at 11:19am

Edited: 20/08/2011 11:27am

Hi all,

Still very new to SS. Any help would be much appreciated in getting our categories ability functioning for all pages.

We'd like to present a hierarchical list of checkboxes in the CMS so that multiple categories can be selected for a page. Categories would have sub-categories and maybe sub-sub-categories. Pages can have many categories/subcategories/sub-sub-categoires and vice versa.

Say we created a database table by creating a class to extend dataobject that held all the categories, sub categories etc. Would we be able to populate the TreeMultiSelectField or TreeDropdownField using the table we created?

It seems like TreeDropdownField or TreeMultiselectField would be the most appropriate choice for a hierarchical checkbox. However I'm not quite sure whether it has to work off the SiteTree only.

I've considered the ComplexTableField field but that would seem utterly repetitive if it were presented like so:

select category

Checkbox | Category (Country) | Sub-Category (City )
| Australia | Sydney
x | Australia | Melbourne
| Australia | Brisbane
x | New Zealand | Wellington
| New Zealand | Auckland

(seems like the editor here messed up my table - oh well you get the idea hopefully).

As I said still very new to SS so maybe there is something I'm missing about how we can tackle this challenge. Any suggestions/ help at all would be very much appreciated.

Other threads i've found related to the problem include this one: http://silverstripe.org/general-questions/show/7470