I see two types of ways to register widgets. Why would we chose one over the other? is the first for ones with specific view Components? here are two ways I have them. One is a widget I am working on for creating sliders (Based it off of the articles widget in dancing goat), the other is just the example from the documentation.
[assembly: RegisterWidget(SlidersWidgetViewComponent.IDENTIFIER, typeof(SlidersWidgetViewComponent), "Slider", typeof(SlidersWidgetProperties), Description = "Displays slides based on path.", IconClass = "icon-l-list-article", AllowCache = true)]
[assembly: RegisterWidget("Intranet2021.Widgets.NumberWidget", "Selected number", typeof(NumberWidgetProperties), customViewName: "~/Components/Widgets/Number/_NumberWidget.cshtml", IconClass = "icon-octothorpe")]
As far as I can tell, the first one is used in .NET Core MVC (refer to docs), and the second one - in .NET MVC5 (refer to docs).
Please, sign in to be able to submit a new answer.