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.
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.
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")]
[PluginController("MyApp")]
public class MyTreeController : TreeController
{
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
{
}
protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
{
}
}
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.
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:
https://github.com/umbraco/AngularWorkbook
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:
https://our.umbraco.org/documentation/Extending/Section-Trees/trees-v7
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
orTreeController
- the latter encapsulates a few things based on theTreeAttribute
so you don't have to define everything - e.g. (a skeleton class for you):I did find I could edit the route using
but I'm having the same issues as this ticket
http://issues.umbraco.org/issue/U4-6617
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 : https://bitbucket.org/dawoe/umbukfestival2014/
The video of the talk is also up on youtube : https://www.youtube.com/watch?v=_sX9eZSn9HI
I explain how to set up the tree controller and how the routing works.
Dave
is working on a reply...