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

ModelAdmin & Hierarchy, possible?


Go to End


2 Posts   1221 Views

Avatar
WebInt

Community Member, 14 Posts

5 January 2012 at 12:32am

Edited: 05/01/2012 12:43am

Hi,

I have a query about implementing SiteTree-like hierarchy in ModelAdmin.

First of all, is it possible? I need to manage my objects, with categories (and an indefinite number of sub categories) in ModelAdmin. Ideally, I'd like basically another SiteTree in another tab, to avoid the clutter of the other pages.

Cheers.

Avatar
swaiba

Forum Moderator, 1899 Posts

5 January 2012 at 1:02am

It is possible, I used to have a systen that used the sitetreeasUL functions and created one from data objects. But I replaced it with modeladmin (as it was hacky and tons of code).

SS3 will be using jstree and it looks very simple to create a tree from a dataobject set...

This could show the dataobjects found by the search as the root nodes,
clicking on the icon brings up the normal edit form and clicking on
the pluss opens up the "child" or relating objects.
It would need...
*icon (as you say)
*function getTreeNodeName
*a way to indicate relationships not to follow (in other words "sink"
objects)