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".
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 ;)
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
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:
(The value of Constants.Applications.Developer is the string "developer"). I have tried using a hard-coded string, too.
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!
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 ;)
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
Ahh, thanks guys, spot on! That was the problem. Cheers! :)
is working on a reply...