Copied to clipboard

Flag this post as spam?

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


  • Dennis 33 posts 238 karma points
    Feb 10, 2015 @ 15:52
    Dennis
    0

    Create root view for custom TreeController

    Hi all I have created anice and well working custom section. Now I need to have a frontpage to one of my trees, and it's where I need help. How can I specify a route for the root of the tree?

    GetTreeNodes is not called when the root is clicked, is there another method I need to override?

     

    Thanks in advande :)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 10, 2015 @ 16:04
    Jan Skovgaard
    0

    Hi Dennis

    What does the code for you custom section look like?

    Perhaps you can find some useful information by reading this blogpost by Tim Geyssens? http://www.nibble.be/?p=440

    You need to get hooked up on angularjs in order to edit your data using views in the backoffice if that is what you have in mind. The Angular Workbook is also a good ressource for that - It has a section about how to create views for a custom tree in the backoffice. https://github.com/umbraco/AngularWorkbook

    Hope this is what you're looking for.

    /Jan

  • Dennis 33 posts 238 karma points
    Feb 10, 2015 @ 16:14
    Dennis
    0

    Jan thanks for the quick answer, I have fully control of AngularJS this is not an issue. I have read the blogpost by Tim Geyssens but there's nothing there on how to have e "fronpage" to a tree. 

    What I am looking for is the same behaviour as Umbraco's own Settings->Dictionary where a list of keys and country codes are shown.

    I can see Umbraco is making some special URL. how can I set this up my self?

  • Dennis 33 posts 238 karma points
    Feb 10, 2015 @ 16:18
    Dennis
    101

    I found a similar issue where a custom routing is prefered. I used the same solution but overrided the CreateRootNode method instead. It's very important to note, that the route have to be in the specific format "/Application/TreeAlias/view/id, if id is omitted the route will be in umbraco/views and not in App_Plugins. Here's the Umbraco answer I found:

    https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/46710-Optional-view-as-opposed-to-edithtml-for-tree-action

    Here's how I implemented it:

    protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
        {
            // routepath HAS to be /appsection/treealias/htmlview/ID 
            var route = "/Cordura/StatisticTree/index/0";
            return CreateTreeNode("statistics", null, queryStrings, "Statistik", "icon-server", false, route);
        }
    
  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 10, 2015 @ 16:38
    Jan Skovgaard
    0

    Hi Dennis

    Aaah, ok - Well seems like you found a way of dealing with it. But otherwise I think that perhaps the Google Analytics for Umbraco project by Warre Buckley and Tim Geyssens are featuring the same thing actually and may be a good reference as well :)

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft