+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Sitefinity Custom Module and MVC Widgets

Sitefinity Custom Module and MVC Widgets

8 posts, 0 answered
  1. Catherine
    Catherine avatar
    2 posts
    Registered:
    04 Oct 2013
    29 Oct 2013
    Link to this post
    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.
  2. Jonathan
    Jonathan avatar
    119 posts
    Registered:
    19 Dec 2012
    29 Oct 2013 in reply to Catherine
    Link to this post
    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.
  3. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    22 Sep 2016
    01 Nov 2013
    Link to this post
    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,
    Stanislav Velikov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Victor
    Victor avatar
    94 posts
    Registered:
    15 Jun 2011
    23 Nov 2013 in reply to Stanislav Velikov
    Link to this post
    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" />
  5. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    16 Nov 2015
    Link to this post

    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: http://docs.sitefinity.com/feather-create-widgets

    ?

  6. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    22 Sep 2016
    19 Nov 2015
    Link to this post
    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
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  7. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    24 Nov 2015 in reply to Stanislav Velikov
    Link to this post
    Is this only for Feather (I.E. MVC or can we create regular ascx widgets in separate assemblies too?)
  8. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    22 Sep 2016
    27 Nov 2015
    Link to this post
    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
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
8 posts, 0 answered