Copied to clipboard

Flag this post as spam?

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


  • Qube 74 posts 116 karma points
    Jul 06, 2010 @ 07:24
    Qube
    0

    Custom Tree, No Application Section

    I'm in the middle of making my first umbraco tree. It will never be associated with an application section. Instead, it will be used exclusively as a modal picker for a custom data type. I want it to work similarly to the content picker data type.

    So my questions are:

    • If the tree isn't part of an application, does it actually need to go in the [umbracoAppTree] table?
      • If so, do I just leave the [appAlias] column blank?
      • If not, will the custom tree be automatically picked up, similarly to the data type itself?

    Appreciate your help!

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Jul 06, 2010 @ 10:59
    Richard Soeteman
    0

    Hi Ben,

    You need to configure the tree in the database. but you could also use the content tree I think. What I would suggest is to pick a custom tree project on this site and look at their source code to see how they solved the issues.

    Hope this helps you,

    Richard

  • Qube 74 posts 116 karma points
    Jul 07, 2010 @ 04:18
    Qube
    0

    Thanks for the response Richard. I think you might be right. Combing through other projects, I can't see any evidence of umbraco Trees without an application and database records to match.

    But then, the concept of app independent trees is at least alluded to around the place. For example in Shannon Deminick's article on FARMCode.org (and also here):

    TreeAlias
    By default this is set to the alias name specified in the umbracoAppTree table. However, in some cases not all trees will be defined in the database and therefore this property should be overridden.

    Analysing the source code for TreeDefinitionCollection, it at least looks *possible*. I guess I'll have to run the umbraco project locally, attach the IIS process and step through the code to see if my custom Tree gets picked up. *sigh* :)

    P.S. The only reason I'm pushing this is that it's really inappropriate for this tree picker to associated with any app. It really should be independant. Plus, I don't want any database requirements to make it work.

  • Qube 74 posts 116 karma points
    Jul 07, 2010 @ 05:49
    Qube
    0

    OK, results time. Stepping through the code revealed some good news and some bad news.

    Good news: Custom trees are detected based on their base type or interface. My tree was found :)

    Bad news: Custom trees are not registered unless they have a matching app. My tree was rejected :(

    Interestingly, I can get my custom non-application tree to work using the "old" tree method. Just not the new 4.1 way. *double sigh*

    I'm going to bang away at this a little longer before I try alternative methods.

  • Qube 74 posts 116 karma points
    Jul 13, 2010 @ 08:45
    Qube
    1

    Hey Richard. I've marked your answer as the solution. It wasn't what I wanted to hear, but you were 100% right :)

    I'm going to put some suggestions forward about how the new tree works. There are some strange behaviours (especially around tree pickers) that could be improved.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 13, 2010 @ 09:14
    Dirk De Grave
    0

    Hi Ben,

    Be sure to get some suggestions up, it's what this community is about, sharing and improving the product so the whole community can benefit from this. +1 from me!

     

    Cheers,

    /Dirk

  • Soeren Sprogoe 575 posts 259 karma points
    Jul 15, 2010 @ 15:34
    Soeren Sprogoe
    1

    I'm currently looking into exactly the same thing: Making my own custom data type with a custom tree / custom picker, generated from an external data source.

    I know how to make custom sections and trees in Umbraco, just can't wrap my head around how / if this can be used for a data type.

    Would be nice with some suggestions from the experts on how to solve this, as it seems like a common problem.

    /SoerenS

  • Qube 74 posts 116 karma points
    Jul 16, 2010 @ 01:03
    Qube
    0

    Hey Soeren. I know exactly what you mean. My implementation involves an external data source too (though I'm not ready to say what it is ;).

    I ended up posting this as a suggestion over here: Suggestion: App Independent Trees. Please give it a high five if you agree.

    While it is possible to create your own copy of TreeControl (/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx) to do what you want, you then need to make your own picker page (/umbraco.presentation/umbraco/dialogs/treepicker.aspx) to contain the control. That also stops you using TreeUrlGenerator, because you'll be using your own page. And so on... *sigh*

    That's a lot of custom work when the base implementation is so close!

  • Soeren Sprogoe 575 posts 259 karma points
    Jul 16, 2010 @ 09:16
    Soeren Sprogoe
    0

    Hi-five given :-)

    I had a short look at Shannon's Multi-node Tree Picker. Looks like it's using some sort of umbraco user control for the tree, however it seems like this is only part of Umbraco v4.5. Which I'm not using yet.

    So the option possibly is to look outside of Umbraco for a solution, maybe there's some jquery thing that can turn XML data into a tree.

    /SoerenS.

Please Sign in or register to post replies

Write your reply to:

Draft