From my understanding you would not edit this file directly, instead create a C# controller which inherits from TreeController see here. There are two main functions to consider.
GetTreeNodes which basically creates the hierarchical node structure and GetMenuForNode which populates the list of available actions in the slide out dialog which normally appears when you click on a tree node item. For the content tree this is populated with copy,move delete et cetera. The decorator in the code example provided starting with..
Thank you for your help. However, I am still not clear how to use this.
I have downloaded the entire source. I tried to add this to umbraco.web and umbraco.web.ui, but none worked.
I also tried to create an empty solution and used nuget package to get umbraco.cms, and after that tried to add the example but didn't work either. I am not sure what I have missed. Can someone provide some advise? Thank you.
I think the tutorial provided is pretty good if you've not done this before you just need to go throught everything step by step. I can confirm there is no need to install the umbraco source just the nuget package into an empty web solution. When you have done that can you confirm the solution builds. Log into the backoffice navigate to settings and take a screenshot and post on here. Also go into the app_data folder of your solution logs and copy and paste say the last 100 lines from the latest log and post here.
I am able to build and run this example. However, after I clicked on the "Import" button, this is what I got, not seeing "Hello World" defined in json file:
I saw this error in the console:
Error: Argument 'UmbExtend.UmbExtendTree.ImportController' is not a function, got undefined
Bear in mind the tutorial is a guide for you to get an idea how things work. When you create your own tree you may decide not to put it under the settings section (umbracos alternative name for a section is 'application' so look out for that term.) .
Now the answer to your question. Have you got this file in your solution App_Plugins/UmbExtend/BackOffice/umbExtendTree/umbExtend.umbExtendTree.import.Controller.js and does it have the contents shown in the tutorial looks like you have this file missing or placed in the incorrect folder. Check its included in your solution and that it is being loaded by you browser
The file will be the javascript file which is the angular 'controller' for the 'view' you are seeing on the right hand side of the screen. I can tell this by the text blocks in curly brackets which are placeholders and instead of displaying as they are should be displaying the value of a variable set on the '$scope' of the missing controller. The reason its not working is that for every node in the tree there has to be a view on the right hand side which requires an angular controller written in javacript to function correctly. For example in the content tree each node uses the content editing view and controller that comes inbuilt into umbraco. You will create your own views and controllers for your sections / applications and their tree nodes.
No worries keep learning. Look at.the logs (dont always post them as i asked on this occasion) and post errors or grabs if they might reveal whats going on as you have here . There lots of answers and tips on here already but you should get plenty of help from folks here
Tree Config question
Hello, I am trying to understand how elements and attributes work in "tree.config". I saw this:
So if I want to add custom elements, is this what I need to modify? What does all attributes mean?
From my understanding you would not edit this file directly, instead create a C# controller which inherits from TreeController see here. There are two main functions to consider.
GetTreeNodes which basically creates the hierarchical node structure and GetMenuForNode which populates the list of available actions in the slide out dialog which normally appears when you click on a tree node item. For the content tree this is populated with copy,move delete et cetera. The decorator in the code example provided starting with..
corresponds to "application alias", "alias" and "title". Other options also include iconClosed, iconOpen, initialize and sortOrder.
umbraco then populates trees.config from these settings. You will find several tutorials online and on umbracotv to get you started
Thank you for your help. However, I am still not clear how to use this.
I have downloaded the entire source. I tried to add this to umbraco.web and umbraco.web.ui, but none worked.
I also tried to create an empty solution and used nuget package to get umbraco.cms, and after that tried to add the example but didn't work either. I am not sure what I have missed. Can someone provide some advise? Thank you.
I think the tutorial provided is pretty good if you've not done this before you just need to go throught everything step by step. I can confirm there is no need to install the umbraco source just the nuget package into an empty web solution. When you have done that can you confirm the solution builds. Log into the backoffice navigate to settings and take a screenshot and post on here. Also go into the app_data folder of your solution logs and copy and paste say the last 100 lines from the latest log and post here.
I am able to build and run this example. However, after I clicked on the "Import" button, this is what I got, not seeing "Hello World" defined in json file:
I saw this error in the console:
Error: Argument 'UmbExtend.UmbExtendTree.ImportController' is not a function, got undefined
Any suggestion on how to fix this? Thank you
Bear in mind the tutorial is a guide for you to get an idea how things work. When you create your own tree you may decide not to put it under the settings section (umbracos alternative name for a section is 'application' so look out for that term.) .
Now the answer to your question. Have you got this file in your solution App_Plugins/UmbExtend/BackOffice/umbExtendTree/umbExtend.umbExtendTree.import.Controller.js and does it have the contents shown in the tutorial looks like you have this file missing or placed in the incorrect folder. Check its included in your solution and that it is being loaded by you browser
The file will be the javascript file which is the angular 'controller' for the 'view' you are seeing on the right hand side of the screen. I can tell this by the text blocks in curly brackets which are placeholders and instead of displaying as they are should be displaying the value of a variable set on the '$scope' of the missing controller. The reason its not working is that for every node in the tree there has to be a view on the right hand side which requires an angular controller written in javacript to function correctly. For example in the content tree each node uses the content editing view and controller that comes inbuilt into umbraco. You will create your own views and controllers for your sections / applications and their tree nodes.
I got it working now. Thank you, Ian. I very much appreciate your help to a beginner.
No worries keep learning. Look at.the logs (dont always post them as i asked on this occasion) and post errors or grabs if they might reveal whats going on as you have here . There lots of answers and tips on here already but you should get plenty of help from folks here
is working on a reply...