Convert Deprecated Gadgets to Components in #Episerver

This guide shows you how you easily can convert your obsolete MVC gadgets to Component without being a dojo guru. With or without MVC pattern.

Published 8th of June 2017
For Episerver Version 10.6

Gadgets is obsolete from CMS version 10.6

Gadgets has been around in Episerver since CMS 6, and the foremost advantage with Gadget pattern compared with the recommended Components was that it was easy to implement (just make a controller and decorate it with some attributes), quite straight forward and easy. The Components framework seems a little bit more complex, the examples provided by Episerver are involving dojo javascript programming which may not be intuitive to so many, yeah, maybe to no one 😉

BUT Episerver provides a short cut, IFrameComponent, with which I will use to illustrate how you easily can upgrade your gadget to component.

You might think IFrame suck, but if you don’t need the Episerver context, for example in dashboard, this might be a good way. I’m planning to write a guide how do upgrade this example without IFrame, and with dojo, but we’ll see about that.

This example is for administrating users for the also obsolete and legacy Subscription system build in Episerver. It is a dashboard for listing and removing users from the subscriptions on the website.

So let’s start with legacy gadget:

Change Gadget to IFrameComponent, add URL property, and categories, remove all resources. Categories can be “cms,content,dashboard”

The URL must relate to the routing added

In this example I´m not using any view instead just returning HTML from a string. But view will work as usual. You’ll just need to add a _layouts with your resources. In my code I just inline it in the htmlstring.

  

Gist: https://gist.github.com/LucGosso/ec1c38d9bb7a2360fc276a693ef8dd6c CS and JS file

Resources:

SEO terms:

  • The Episerver gadget framework has been deprecated and was replaced by the Episerver Components.
  • How to convert EPiServer gadget to component
  • Creating a component without dojo
  • Gadget to Component with MVC views
  • Create an IFrame Component from a Dashboard gadget
  • Component to administrate subscription users in Episerver
Like it? please up vote
3