Copied to clipboard

Flag this post as spam?

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


  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    May 19, 2014 @ 21:43
    Dan Diplo
    0

    Creating a custom U7 Tree NOT in the "Settings" section

    I've been creating a custom Umbraco 7 tree following the official tutorial and those dotted around the web. It's all working fine except for one problem - my custom tree always appears as the second item in the Settings menu.

    My Tree Controller has the appAlias value of the Tree attribute set to "developer" but this seems to be ignored. My code:

    [Tree(Constants.Applications.Developer, "diploTraceLog", "Trace Logs")]
    [PluginController("DiploTraceLogViewer")]
    public class TraceLogTreeController : TreeController
    {
    

    (The value of Constants.Applications.Developer is the string "developer"). I have tried using a hard-coded string, too. 

    Basically, doesn't seem to matter what I put as the first parameter to [Tree("...")] - my tree always appears in Settings. ie. if I change it to:
    [Tree("bananas", "diploTraceLog", "Trace Logs")]

    The tree still renders under Settings (between Stylesheets and Templates).

    Don't think this is a caching issue since I've disabled browser caching and it survives IIS Express reset as well as an entire machine reboot! Other changes I make do appear fine.

    Also, suspicously, all the online examples seem to use "settings" as the default value. Has anyone ever actually got it to work for another section? I specifically want "developer".

    Help!

  • Anders Bjerner 487 posts 2990 karma points MVP 8x admin c-trib
    May 19, 2014 @ 22:38
    Anders Bjerner
    100

    When creating a new tree, a line is added to /config/trees.config with information about your tree.

    From what I can tell Umbrao doesn't change the application alias in the config file if you change it in your code. So either try deleting that line, or just simply set the new application alias. Should work again after a rebuild/iisreset ;)

  • Per Ploug 865 posts 3491 karma points MVP admin
    May 19, 2014 @ 23:23
    Per Ploug
    1

    Yeah, as anders said, when you are developing and switching alias's around in the attribute, that trees.config probably doesnt update if the tree is already there (normally those values wouldnt change)

    So clear your trees.config, restart app pool and see if that works

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    May 19, 2014 @ 23:26
    Dan Diplo
    0

    Ahh, thanks guys, spot on! That was the problem. Cheers! :)

     

Please Sign in or register to post replies

Write your reply to:

Draft