I'd like to customize a widget created for a dynamic content type:
Productions Production (module, content type)
I'd like it to only work with the Bootstrap resource package. I know a template is generated by feather when i saved the dynamic content type, and I see it listed and editable from:
(attached is an image showing the screen)
But what I want is to customize the template only for the bootstrap resource package; and include it there like I the convention seems to be.
did not work
The convention requires that:
Please note that if you have the same template name in Backend and in the file system (i.e. List.Production.cshtml), the latter will take precedence.
Let me know if it still doesn't work as expected.
That works. However you should note that to override in the file system its' actually:
MVC/Views/[Developer name of content type]/List.[Display name of content type].cshtml
This is important to note when you create content types with spaces in the name. For instance:
My Content Type
MVC/Views/MyContentType/List.My Content Type.cshtml
MVC/Views/MyContentType/Detail.My Content Type.cshtml
Basic: Most built in widgets have template selectors. For instance, say you want an additional template for News Listings for your bootstrap package. You can just drop the cshtml file in the ResourcePackages/Bootstrap/Mvc/Views/News/ folder, but make sure it starts with List, e. g. List.MyNewsList.cshtml should work. The Dynamic Content Widget works this way as well.
More technical: when you look at the news controller, you'll see a property ListTemplateName. This can be set via the widget designer. well how does the designer code, which is a hodge-podge of razor and bootstrap and angular, know what are the possible templates? Look at the following code:
<select id="newsTemplateName" ng-model="properties.ListTemplateName.PropertyValue" class="form-control">
@foreach (var viewName in Html.GetViewNames("News", @"List\.(?<viewName>[\w\s]*)$"))
<option value="@viewName"> @viewName</option>
@foreach (var viewName in Html.GetViewNames("News", @"List\.(?<
The helper method Html.GetViewNames is how. Also, notice the matching expression it uses to find the templates.
PS: I cannot overly stress how important it is for anyone implementing feather to get real intimate like with the feather-widgets project. I have all my developers keep a local copy of the project and keep it open as a reference.
Is it possible to create multiple views this way or is it only possible to override the default list and detail template? I prefer this way to sitefinity thunder because I can save the file to source control.