Skip to content

Instantly share code, notes, and snippets.

@patfog patfog/InitModule.cs
Last active Aug 15, 2018

Embed
What would you like to do?
Episerver - minimal admin plugin
using System.Web.Mvc;
using System.Web.Routing;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
namespace Sandbox.CMS.Plugins
{
public class InitModule : IInitializableModule
{
public void Initialize(InitializationEngine context)
{
// Add support for attribute routing
RouteTable.Routes.MapMvcAttributeRoutes();
}
public void Uninitialize(InitializationEngine context)
{
}
}
}
using System.Web.Mvc;
using EPiServer.PlugIn;
namespace Sandbox.CMS.Plugins
{
[GuiPlugIn(
Area = PlugInArea.AdminMenu,
Url = "/" + MyTestControllerPath,
DisplayName = "My Plugin")]
[Authorize(Roles = "CmsAdmins")]
[Route(MyTestControllerPath)]
public class MyTestController : Controller
{
internal const string MyTestControllerPath = "custom-plugins/my-plugin";
public ActionResult Index()
{
return Content("Found");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.