Heya Simon,
It shouldnt matter where you put the RegisterWidget attribute. For widgets that dont have a custom class like this one, I would reccommend making a PageBuilderComponentRegister.cs
class in the same folder as Startup.cs, that just contains a big list of these registrations, eg;
PageBuilderComponentRegister.cs
[assembly: RegisterWidget("LearningKit.Widgets.NumberWidget", "Number selector", typeof(NumberWidgetProperties), customViewName: "~/Components/PageBuilder/Widgets/NumberWidget/_NumberWidget.cshtml")]
[assembly: RegisterWidget("LearningKit.Widgets.ExampleWidget1", "Example widget 1", typeof(NumberWidgetProperties), customViewName: "~/Components/PageBuilder/Widgets/ExampleWidget1/_ExampleWidget1.cshtml")]
However, it sounds like there's another reason why it's not working if you're including it in Startup.cs
and its not working...
Would you be able to reply with the view where you're expecting the widget to be included? (It should have a <editable-area>
tag in it)