Copied to clipboard

Flag this post as spam?

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


  • Don Nehc 69 posts 222 karma points
    Jul 07, 2016 @ 16:11
    Don Nehc
    0

    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?

  • Ian 178 posts 752 karma points
    Jul 07, 2016 @ 18:17
    Ian
    0

    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..

    [Tree("settings", "umbExtendTree", "Umbraco Extend")]
    

    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

  • Don Nehc 69 posts 222 karma points
    Jul 09, 2016 @ 13:55
    Don Nehc
    0

    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.

  • Ian 178 posts 752 karma points
    Jul 09, 2016 @ 14:22
    Ian
    0

    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.

  • Don Nehc 69 posts 222 karma points
    Jul 10, 2016 @ 22:25
    Don Nehc
    0

    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:

    enter image description here

    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

  • Ian 178 posts 752 karma points
    Jul 10, 2016 @ 23:29
    Ian
    100

    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.

  • Don Nehc 69 posts 222 karma points
    Jul 11, 2016 @ 03:12
    Don Nehc
    1

    I got it working now. Thank you, Ian. I very much appreciate your help to a beginner.

  • Ian 178 posts 752 karma points
    Jul 11, 2016 @ 07:42
    Ian
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft