Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Taylor Mitchell 19 posts 41 karma points
    Sep 28, 2015 @ 13:35
    Taylor Mitchell

    Anyone know of a way to use the TreeController with MVC?

    I am building a custom section.

    I am having trouble with the BaseTree and would rather be using the TreeController, because it's just easier to use. Is there a way to be able to still use MVC instead of Angular and use TreeController? Thanks for any help.

  • Robert Foster 407 posts 1493 karma points admin c-trib
    Sep 28, 2015 @ 14:25
    Robert Foster

    Edit: Sorry, bit vague on the actual answer to your question - in short, you can't use MVC with the TreeController.

    I would recommend checking out the AngularJs Workbook found here:

    In relation to trees and editing nodes, there is a convention around where the angular views are located for editing but I'm having a little trouble finding the documentation on it right now. Best thing to do maybe is to read the Umbraco source code for some of the trees.

    Documentation for the TreeController is here:

    It's currently lacking in the Tree Creation area, but contains a lot of useful information anyway.

    To create your own tree, you can either inherit directly from TreeControllerBase or TreeController - the latter encapsulates a few things based on the TreeAttribute so you don't have to define everything - e.g. (a skeleton class for you):

        [Tree("myApp", "myTree", "My Tree")]
    public class MyTreeController : TreeController
        protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
        protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
  • Taylor Mitchell 19 posts 41 karma points
    Sep 28, 2015 @ 15:30
    Taylor Mitchell

    I did find I could edit the route using

    node.RoutePath = "/myroute/"

    but I'm having the same issues as this ticket

  • Dave Woestenborghs 3220 posts 10862 karma points MVP 4x admin c-trib
    Oct 02, 2015 @ 06:49
    Dave Woestenborghs

    Hi Taylor,

    I did a session on creating custom sections using Angular at last years Umbraco UK Festival.

    The source code of that talk can be found here :

    The video of the talk is also up on youtube :

    I explain how to set up the tree controller and how the routing works.


Please Sign in or register to post replies

Write your reply to: