Hello!
I am working on a hobby project that will add an admin plugin and a couple of cms reports. I plan to package it as a nuget package for others to use. Currently I am stuck on how to set the url for the view files (Razor) and where to place them in the project.
I have been looking at a couple projects on GitHub and I currently have this (simplified) file structure:
ProjectRoot
Controllers
MyPluginController.cs
modules
_protected
MyProjectName
Views
MyPlugin
Index.cshtml
My controller looks like this:
[GuiPlugIn(
Area = PlugInArea.AdminConfigMenu,
UrlFromModuleFolder = "Views/MyPlugin/Index",
DisplayName = "This is my plugin"
)]
public class MyPluginController : Controller
{
public ActionResult Index()
{
return View();
}
}
To test my code I have set up the AlloyMvc site as a second project in the solution and set Alloy to depend on my project. My plugin is detected and shows up in the admin interface but the view is not found. (error message reports searched physical path as {pathToSolution}\{theAlloyMvcProjectName}\EPiServer\CMS\Admin\MyPlugin\Index)
The EPiServer documentation on custom reports specifies a url in a hardcoded way and adds a route in the global.asax file but that is not an option.
I hope for a solution that makes it easy to test while coding and that also will work when package as a nuget and installed by someone else. What do I need to configure and where?