Copied to clipboard

Flag this post as spam?

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


  • Christian Palm 278 posts 273 karma points
    Jun 16, 2010 @ 10:32
    Christian Palm
    0

    How to set startnode on TreeInit.aspx (TreeService)

    Hi

    Umbraco v 4.0.4.2

    I can not get the startnode to work when trying to use the TreeService :-( I always get the root.

    TreeService service = new TreeService(1024, "content", false, true, TreeDialogModes.id, "content", "1024");
    string initUrl = service.GetInitUrl();

    And when I try debug by accessing the url directly I get something like this
    /umbraco/TreeInit.aspx?app=content&id=1024

    Should't the tree start at Document id 1024?

    So basicly my quistion is: Is it possible to set the startnode?

     

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Jun 17, 2010 @ 12:15
    Shannon Deminick
    0

    The whole tree thing in pre 4.1 is quite annoying and doesn't make a whole heck of alot of sense :) But, you're sort of on the right track. TreeInit.aspx is the page to use as the address in an iframe to render the tree which will then make async calls to Tree.aspx.

    You'll notice there's another method for your 'service' object like Get...Url ( I can't remember of the top of my head) which should return you the tree.aspx address (instead of the treeinit.aspx address). The tree.aspx page is actually an xml service and will return the xml structure to populate the tree nodes from the current node specified by query strings.

    I'm not sure what you are trying to acheive but am assuming that you might not want just the xml structure of nodes? as  this is all you'll get with Tree.aspx. If you want to actually change the content tree (have full control over what is rendered), you'll need to override a class called loadContent and override the render method (amongst other things). Then you'll need to replace the loadContent tree in the AppTree database table with your own tree type.

    I'm not sure if any of this helps as I don't know what you are trying to acheive, but hopefully it does!

    Shannon

Please Sign in or register to post replies

Write your reply to:

Draft