The problem is my plugin is set up with links to views in a subfolder, but it does not load those views and the last part of the URL is chopped off. Why is this happening?
Overview
I've created a generic plugin. The plugin name is generalPlugin, the tree alias name is generalPluginAlias and the treegroup name is generalPluginGroup.
It has a TreeController set up with nodes to point at generic webpages. Some pages at root level of plugin and some in a subfolder.
This is my code which creates TreeNodes with route paths.
This is how it's rendered on screen. I can click on Tea-Edit and it will load the view from the route path "generalPlugin/generalPluginAlias/tea-edit"
However if I try to load a view from "generalPlugin/generalPluginAlias/cats/edit" or "generalPlugin/generalPluginAlias/cats/edit?id=0" by clicking on the link cats or cats with id, the last part of the URL is cut off and Umbraco website throws an error, saying page cannot be found at "/App_Plugins/GeneralPlugin/backoffice/generalPluginAlias/cats.html".
If you look at the screenshot below, you can see my link in the status pointing at "https://localhost:4432/umbraco/#/generalPluginAlias/cats/edit?id=0" but my Umbraco website is trying to load it from "/App_Plugins/GeneralPlugin/backoffice/generalPluginAlias/cats.html".
I was unable to find a way to load views from sub-directories in my plugin folder.
Instead, I've put all files into one folder at top level and added a category name and action suffix to each filename e.g. dogs-view.html, dogs-edit.html. That works for me.
Out of interest, another developer had the same problem and posted his answers similiar as above.
Plugin - TreeNode is not loading views from folders
HI folks,
I would like your help please. I'm learning to work with TreeNodes and Views. I followed a tutorial at https://our.umbraco.com/documentation/Extending/Section-Trees/trees
Problem
The problem is my plugin is set up with links to views in a subfolder, but it does not load those views and the last part of the URL is chopped off. Why is this happening?
Overview
I've created a generic plugin. The plugin name is generalPlugin, the tree alias name is generalPluginAlias and the treegroup name is generalPluginGroup.
It has a TreeController set up with nodes to point at generic webpages. Some pages at root level of plugin and some in a subfolder.
This is my code which creates TreeNodes with route paths.
This is how it's rendered on screen. I can click on Tea-Edit and it will load the view from the route path "generalPlugin/generalPluginAlias/tea-edit"
However if I try to load a view from "generalPlugin/generalPluginAlias/cats/edit" or "generalPlugin/generalPluginAlias/cats/edit?id=0" by clicking on the link cats or cats with id, the last part of the URL is cut off and Umbraco website throws an error, saying page cannot be found at "/App_Plugins/GeneralPlugin/backoffice/generalPluginAlias/cats.html".
If you look at the screenshot below, you can see my link in the status pointing at "https://localhost:4432/umbraco/#/generalPluginAlias/cats/edit?id=0" but my Umbraco website is trying to load it from "/App_Plugins/GeneralPlugin/backoffice/generalPluginAlias/cats.html".
Why was my URL cropped?
I was unable to find a way to load views from sub-directories in my plugin folder.
Instead, I've put all files into one folder at top level and added a category name and action suffix to each filename e.g. dogs-view.html, dogs-edit.html. That works for me.
Out of interest, another developer had the same problem and posted his answers similiar as above.
https://our.umbraco.com/forum/developing-packages/87713-custom-section-tree-node-route-path-takes-from-view-folder
is working on a reply...