I was wondering if it is possible to override existing controller behavior, like you can override templates. For instance, say I want to modify the model i pass to my list view of dynamic content. Looking through the feather documentation, I found this article which seems to be related:
How to implement a Master Detail content controller
But overall the documentation on what is going on, especially with Dynamic Content, is a bit sparse. So I am trudging through the source code but, well, there's no actual controllers there; there's this code:
private void RenameControllers(SiteInitializer initializer)
var manager = initializer.PageManager;
var controllerNameProperties = manager.GetControls<
.Where(c => c.ObjectType == "Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy" || c.ObjectType == "Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.MvcWidgetProxy, Telerik.Sitefinity.Frontend")
.SelectMany(c => c.Properties.Where(p => p.Name == "ControllerName"));
foreach (var property in controllerNameProperties)
if (property.Value == "News.Mvc.Controllers.NewsController")
property.Value = "Telerik.Sitefinity.Frontend.News.Mvc.Controllers.NewsController";
else if (property.Value == "ContentBlock.Mvc.Controllers.ContentBlockController")
property.Value = "Telerik.Sitefinity.Frontend.ContentBlock.Mvc.Controllers.ContentBlockController";
else if (property.Value == "Navigation.Mvc.Controllers.NavigationController")
property.Value = "Telerik.Sitefinity.Frontend.Navigation.Mvc.Controllers.NavigationController";
else if (property.Value == "SocialShare.Mvc.Controllers.SocialShareController")
property.Value = "Telerik.Sitefinity.Frontend.SocialShare.Mvc.Controllers.SocialShareController";
else if (property.Value == "DynamicContent.Mvc.Controllers.DynamicContentController")
property.Value = "Telerik.Sitefinity.Frontend.DynamicContent.Mvc.Controllers.DynamicContentController";
But none of those controllers actually exist in the projects: searching for those strings results in no results.
So I looked into MvcControllerProxy, but there's not a whole lot going on there.
While I wait for feedback, I'm going to build my project with the source of feather and throw a bunch of break points everywhere to see if I can figure out some of this magic.
There also seems to be some clues here:
But then that points to SitefinityControllerFactory for creation:
public class FrontendControllerFactory : SitefinityControllerFactory, IDisposable
public override IController CreateController(RequestContext requestContext, string controllerName)
var baseController = base.CreateController(requestContext, controllerName);
Well my research has lead me to a different repository: Sitefinity/feather-widgets
There's a lot of good stuff here especially concerning how the controllers are implemented, but I'm still not sure how to override the existing controllers.
From what I cant tell, there's no way to do this by convention. I do believe you can do something like set the controller to use for a widget from the Toolboxes.config:
Sorry to reopen an answered post, but I am pondering the same question... did you figure out how to extend Dynamic Content Widgets, most specifically the controller?
I'm fine creating custom templates (list / detail) that can be selected within the widget when added to the page.
I've tried creating a custom controller and inheriting from Telerik.Sitefinity.Frontend.DynamicContent.Mvc.Controllers.DynamicContentController
but most of the properties / actions aren't overridable and can't access private variables.
How did you achieve this other than copy / pasting the code from the Feather Github repo and just renaming the controller.
Given that, how do you register the new controller to execute over the default controller??
I look forward to a response as this would help me immensely.
Up to now, I've relied on placing logic inside custom templates which I just don't feel is maintainable and is a little hard trying to test with.
I want to do a similar thing with Events widget. Along with the default event widget designer I want to add 2 custom fields to the Events widget designer :1. simple text box and 2. a page selector and use the values entered by the user in these fields in my custom event widget template for display on the website.
This post says that we need to extend the built-in widget and then use custom widget to add custom functionalities however I am not sure how to start with extending the built in event widget functionality in a custom widget and it would be really helpful if you could provide me some guidance to start with.
I tried using the steps extend widget designer document for event widget but it does not give any information on how to edit the controller/model as I need to read /write the values from the custom fields.
Thanks for your response. So you mean I would have to duplicate the entire functionality of events widget in my custom widget so that I can modify the controller to add 2 more properties?? Is there no way I can inherit the built in controller in my custom widget's controller and add my logic for the 2 additional properties?
Kevin, we're also looking into this at them moment. How can we extend the controller to make use of the out of the box setup, with custom additional functionality?
Surely there must be an easier way?
Joining the party...
If we don't inherit from DynamicContentController
The Model Helper: github.com/.../DesignerModelHelper.cs
Will fail at line 152. Because the controller is not of the correct type. I am seeing this in stock widget designer with method calls like Model.ContentTypeDisplayNamePlural(). Which will cause a HTTP 500 Error.
Making the Index and Details Actions on the DynamicContentController overridable might help.
My only solution is to c&p everything, rename, and hack up the widget designer.