One of my main projects is a site that was built on the EPiServer CMS a couple years ago. The site depends on a set of product data, and I wanted to give site admins the ability to manage that data in the EPiServer admin interface. I knew EPiServer could be extended with plugins, but I had a difficult time figuring out the exact steps to make my own plugin.
Eventually I discovered that making a basic plugin is actually really simple. It only requires a controller and a view, plus two more key pieces: authorization on the controller, and a menu provider.
Here is a simplified version of the steps I took to create my plugin:
Make the controller
A regular .NET MVC controller. I decorated it with the Authorize attribute to limit access to CMS admins only.
Don’t forget to set up its route, for example in global.asax:
Make the view
View itself:
_layout.cshtml (uses EPiServer’s header):
Make the menu provider
This adds a link to the plugin in the top nav bar in EPiServer:
ProductDataMenuProvider.cs:
That’s all it takes to create a super-basic EPiServer plugin!