Possible to have multiple TreeControllers/Sections per Plugin?
I read through and followed the directions for creating a new section and tree in a separate plugin project. (https://docs.umbraco.com/umbraco-cms/extending/section-trees/trees)
It worked fine, but when I tried to add a second section with its own tree to the same plugin it seemed I could get one or the other to work but not both. At times it seemed that clicking one section would send the user to the other, almost bleeding between the two. Is there some fundamental constraint that limits us to having one section or tree per plugin?
Here is how I set up one of them, with everywhere that says 'blogs' replaced by a different string for the second implementation
The PluginController decoration is to help with the routing of requests in the Umbraco backoffice, particularly if you are going to release your code as a plugin or package.
Essentially you might create a TreeController that clashes with the name of one provided by a third-party package so Umbraco gives this mechanism to allow you to isolate your custom Tree under a custom path.
So if you are creating two different TreeControllers for different purposes, then yes, I'd expect them to have different 'plugincontroller' names, one for each purpose, but those two TreeControllers could be release as part of the same package if that makes sense!
if you have two TreeControllers with the same plugincontroller name then the routing of the request will likely intefere with each other.
I did try with each TreeController's '[PluginController]' attribute configured with a different name and still had bleed over issues. Maybe I'll revisit this again -- in the meantime I can just keep one plugin assembly per section. It is likely I did something odd since this is my first plugin.
Possible to have multiple TreeControllers/Sections per Plugin?
I read through and followed the directions for creating a new section and tree in a separate plugin project. (https://docs.umbraco.com/umbraco-cms/extending/section-trees/trees)
It worked fine, but when I tried to add a second section with its own tree to the same plugin it seemed I could get one or the other to work but not both. At times it seemed that clicking one section would send the user to the other, almost bleeding between the two. Is there some fundamental constraint that limits us to having one section or tree per plugin?
Here is how I set up one of them, with everywhere that says 'blogs' replaced by a different string for the second implementation
Hi npack
The PluginController decoration is to help with the routing of requests in the Umbraco backoffice, particularly if you are going to release your code as a plugin or package.
Essentially you might create a TreeController that clashes with the name of one provided by a third-party package so Umbraco gives this mechanism to allow you to isolate your custom Tree under a custom path.
So if you are creating two different TreeControllers for different purposes, then yes, I'd expect them to have different 'plugincontroller' names, one for each purpose, but those two TreeControllers could be release as part of the same package if that makes sense!
if you have two TreeControllers with the same plugincontroller name then the routing of the request will likely intefere with each other.
regards
Marc
Thanks Mark,
I did try with each TreeController's '[PluginController]' attribute configured with a different name and still had bleed over issues. Maybe I'll revisit this again -- in the meantime I can just keep one plugin assembly per section. It is likely I did something odd since this is my first plugin.
Hi npack
fingers crossed, excited now for when the plugin is released!
regards
marc
is working on a reply...