November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
The two most helpful blog posts related to this would be:
http://world.episerver.com/Blogs/Linus-Ekstrom/Dates/2014/4/Adding-custom-views-to-your-content/
http://world.episerver.com/Blogs/Duong-Nguyen/Dates/2013/12/Custom-views-and-plugin-areas-in-EPiServer-75/
I would suggest you verify that you have the correct assembly name in your web.config, especially if your module lives inside of your project.
In one of my recent EPiServer 7.5 test sites, where the module lives directly under "~/modules/", this is what my <episerver.shell> looks like:
<episerver.shell> <publicModules rootPath="~/modules/" autoDiscovery="Modules"> <add name="MY_MODULE_NAME"> <assemblies> <add assembly="MY_PROJECT_NAME" /> </assemblies> </add> </publicModules> <protectedModules rootPath="~/EPiServer/"> <add name="Shell" /> <add name="CMS" /> <add name="EPiServer.Packaging.UI" /> </protectedModules> </episerver.shell>
First of all thanks for the quick response but i still have an empty page (404 error) :-(.
My web.config now looks like this:
episerver.shell> <publicModules rootPath="~/modules/" autoDiscovery="Modules"> <add name="MyAdminPlugin"> <assemblies> <add assembly="EPiServer.Templates.Alloy.Mvc" /> </assemblies> </add> </publicModules> <protectedModules rootPath="~/episerver/"></protectedModules> </episerver.shell>
My module, which is located at ~/Modules/Alloy/MyAdminPluginController.cs containts the following code:
using System.Web.Mvc; using EPiServer.PlugIn; namespace EPiServer.Templates.Alloy.Modules.Alloy { [GuiPlugIn( Area = PlugInArea.AdminMenu, Url = "/modules/Alloy/MyAdminPlugin/Index", DisplayName = "Webshop bestellingen")] public class MyAdminPluginController : Controller { public string Index() { return "Hello Admin!"; } } }
Other info about my project is:
Project name: AlloyMvc
Assembly name: EPiServer.Templates.Alloy.MvcDefault namespace: EPiServer.Templates.Alloy
I dont understand why episerver doesnt create a route to my guiplugin controller.
Try switching your assembly to:
<episerver.shell> <publicModules rootPath="~/modules/" autoDiscovery="Modules"> <add name="MyAdminPlugin"> <assemblies> <add assembly="EPiServer.Templates.Alloy" /> </assemblies> </add> </publicModules> <protectedModules rootPath="~/episerver/"></protectedModules> </episerver.shell>
If i switch my assembly to that i get an error:
Server Error in '/' Application. Could not load file or assembly 'EPiServer.Templates.Alloy' or one of its dependencies. The system cannot find the file specified. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'EPiServer.Templates.Alloy' or one of its dependencies. The system cannot find the file specified.
Thanks for all the help! I got it working now :-).
The correct web.config setting for me was:
<episerver.shell> <publicModules rootPath="~/modules/" autoDiscovery="Modules"> <add name="Alloy"> <assemblies> <add assembly="EPiServer.Templates.Alloy.Mvc"/> </assemblies> </add> </publicModules> <protectedModules rootPath="~/episerver/"/> </episerver.shell>
I made a couple of mistakes, most of them because i didnt really understand what i was configuring here. What helped for me was this article explaining how the episerver.shell section works:
Configuring episerver.shell Section
The problem for me was the name Alloy and the correct assembly EPiServer.Templates.Alloy.Mvc.
Let me give a simple example that worked for me for people with the same issue:
using System.Web.Mvc; using EPiServer.PlugIn; namespace EPiServer.Templates.Alloy.Modules.Alloy { [GuiPlugIn( Area = PlugInArea.AdminMenu, Url = "/modules/Alloy/MyAdminPlugin/Index", DisplayName = "Webshop bestellingen")] public class MyAdminPluginController : Controller { public string Index() { return "Hello Admin!"; } } }The URL is very important! This URL tells EPiServer were it can find your controller.
<episerver.shell>
<episerver.shell> <publicModules rootPath="~/modules/" autoDiscovery="Modules"> <add name="Alloy"> <assemblies> <add assembly="EPiServer.Templates.Alloy.Mvc"/> </assemblies> </add> </publicModules> <protectedModules rootPath="~/episerver/"/> </episerver.shell>Important is here the <add name="Alloy">. Remember that you named the directory Alloy in ~/modules/Alloy.
You can also just register a normal MVC route. I have updated my original blog post with this information. http://world.episerver.com/Blogs/Paul-Smith/Dates1/2011/8/Creating-EPiServer-AdminEdit-Plug-ins-using-MVC/
Hi,
I found this page about creating admin pages:
http://world.episerver.com/Blogs/Paul-Smith/Dates1/2011/8/Creating-EPiServer-AdminEdit-Plug-ins-using-MVC/
I followed every step of the tutorial but i cant get it working. I do see an item named 'My MVC Admin Plugin' under tools but when i click on it i end up with an empty page. I am building this in the latest version of the Alloy MVC sample site.
This is what i have done so far:
Can somebody please help me because I am really stuck here. I assume the problem is with the assembly because thats the part where i dont know what i am doing exactly.
Thanks!