Jump to:

7936 Posts in 1537 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » DOM and Hierarchy

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 781 Views
  • kindlemanwill
    Avatar
    Community Member
    67 Posts

    DOM and Hierarchy Link to this post

    Hello,

    I want to manage report categories in a tab in report-holder using the DOM. Categories have a parent id and many child id's - they are hierarchical

    Is it possible to use DOM to manage these? And if so, how do you get it to show the nesting / hierarchy? So far, I have a DOM showing the categories with a pop up with fields name & parentid. But the hierarchy dosn't show in the table at all.

    Thanks

    will

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: DOM and Hierarchy Link to this post

    What you can do is add a DOM for the category itself or make a checkbox list to show in the popup. As far as I know the DOM can't show several levels in a hierarchy in a meaningful way, it will just show you a flat list of categories.

    What you can do though is affect how the DOM writes the category names by making your own function for it and putting that in the field list. Then you could do something like what WordPress does where a sub category gets a - before the name and a sub sub category gets -- etc. After that you'd want to do some kind of custom sorting to get them to list in a good way I guess.

  • kindlemanwill
    Avatar
    Community Member
    67 Posts

    Re: DOM and Hierarchy Link to this post

    Hmm, ok thanks. good idea.

    Really though I want to avoid a lot of custom hacking if possible. I feel like im missing something. Silver-stripe must have a native way of dealing with hierarchical categories surely?

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: DOM and Hierarchy Link to this post

    As far as I know there's no native way of dealing with it if we by native mean plug and play. Getting it to show the nesting isn't hard though and the function you'd have to write for it wouldn't have to be many lines. You do have two special select lists that show hierarchical content, the one built in that's used in the access tab and UncleCheese has one called SimpleTreeDropdownField that does pretty much the same thing.

    Uncle Cheese has made a couple of new ones recently and maybe one of them could help you out, I don't know. Anyways, don't be afraid to get your hands dirty with some code.

    781 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.