Sitefinity Custom Module and MVC Widgets
I created a Sitefinity Custom Module (new project) and I was wondering if it was possible to add MVC widget into the module? I know it is possible to add Webforms Widgets, but I have not succeeded for MVC Widgets.
From the little i know(not alot) i believe you can only move the controllers and models outside of the sitefinitywebapp to another due to siteifnity routing reasons.
Hi,
Mvc widgets can`t be coming from an assembly that is different from the assembly of the sitefinity site. Sitefinity requires the controller class and the view to be present locally in the site, the model class can be compiled into an assembly tough. This is because of the way sitefinity which is originally web forms CMS support Mvc controllers to be registered as widgets.
Regards,It's definitely possible to put the Controller & the Model in a separate assembly, but there doesn't seem to be any work-around to get the view in the DLL also. It appears that the view has to be physically present.
Here's how to register the control in the toolbox:
<add enabled="True" type="Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy" controllerType="NameSpace.MVCWidgets.Controllers.BlogPostArchiveController" title="BlogPostArchive" ControllerName="NameSpace.MVCWidgets.Controllers.BlogPostArchiveController" visibilityMode="None" name="BlogPostArchive" />
I'm not entirely sure about the widgets inside modules part, but it seems MVC widgets and their views can be created in a separate project according to this article: docs.sitefinity.com/feather-create-widgets
?
Hello,
Yes this is possible, my last reply on this topic was from 2013 when Sitefintiy MVC was not supporting this.
Now with Sitefinity Feather this is possible based on the documentation you pointed.
Regards,
Stanislav Velikov
Telerik
Is this only for Feather (I.E. MVC or can we create regular ascx widgets in separate assemblies too?)
Hi,
For webforms and .ascx this is available. Refer to this sample in Sitefinity SDK the date picker project contains a control that is stored in external assembly.
Regards,
Stanislav Velikov
Telerik