Try our conversational search powered by Generative AI!

How to convert EPiServer gadget to component

Dan
Dan
Vote:
 

We do have old MVC based dashboard gadget something like this:

[Gadget(Name = "Gadget Name", Title = "Gadget Title",
Description = "Gadget Description",
ClientScriptInitMethod = "epi.myGadget.init")]

public class MyGadgetController : Controller
{
public MyGadgetController()
{
//Some code;
}

[GadgetAction(Text = "List of Activities")]
public ActionResult Index()
{
var activities = GetActivities();
return View(activities);
}

[GadgetAction(Text = "List of Events")]
public ActionResult EventList()
{
var events = GetEvents();
return View(events);
}
}

But, according to EPiServer (this), old Gadget framework is deprecated. So, I want to convert above gadget to EPiServer component. Did many reading on this and couldn't able to figure out how to do that. Specially how to hook MVC components (like views) in a component. Also how to implement GadgetAction behavior

#177837
Edited, Apr 20, 2017 11:42
Dan
Vote:
 

Any help ?

#177883
Apr 21, 2017 14:48
Vote:
 

Did you figure out anything in the end? We are in a similar situation.

#178345
May 09, 2017 17:44
Vote:
 

Bump - having a similar issue here

#179248
Jun 06, 2017 18:28
Vote:
 

Here is a way =) http://devblog.gosso.se/2017/06/convert-deprecated-gadgets-to-components-in-episerver/

#179333
Edited, Jun 08, 2017 13:38
Dan
Vote:
 

Thanks Gosso for your link. But form EPiServer, I got to know that gadgets support will completely remove from EPiServer v11 (it's already deprecated for the moment as well). So I believe it's good to move out from gadgets

#183167
Edited, Oct 06, 2017 8:15
Vote:
 

Yes, Dan, thats right, my blog post shows you how to =)

#183174
Oct 06, 2017 9:08
Vote:
 

Thanks for the link,

Unfortunately we need to use the episerver context for almost every gadget we have.

EDIT: To clarify, our gadgets communicate with the backend to manipulate database and episerver, or just to fetch information about content etc.

#183175
Edited, Oct 06, 2017 9:39
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.