Delete or Disable Out of the Box Feather Widget Templates
The Feather method of selecting different templates for a widget is great, but the out of the box templates are often surplus to requirements. Is there a way to delete or disable these so that only custom templates may be selected?
Hello,
You can remove the default templates by deleting the .cshtml files from the respective folder under ResourcePackages. In this case ResourcePackages -> Bootstrap -> MVC -> Views -> ImageGallery.
Regards,
Velizar Bishurov
Telerik
Hello and thank you for your response.
We're using a completely custom resource package, so ResourcePackages/Bootstrap does not exist in our solution or file system. Somehow, the default Bootstrap views still appear in the template dropdown and selecting them still causes the widget to use the (unstyled) default Bootstrap views.
Are these templates stored anywhere else?
Hello,
In this case you will need to create a custom helper similar to the GetViewNames helper (https://github.com/Sitefinity/feather/blob/6f1c1381faaa80e8114f8e25553767eebc67ee18/Telerik.Sitefinity.Frontend/Mvc/Helpers/ViewSelectorHelpers.cs) that filters out the default views and returns only the custom. You could reuse a call to the default helper and simply filter further.
After that you will need to create a custom designer view and use the custom helper. You can override the default designer view as you would override a default template: http://docs.sitefinity.com/feather-modify-widget-templates
Here is the default image gallery designer view: https://github.com/Sitefinity/feather-widgets/blob/master/Telerik.Sitefinity.Frontend.Media/Mvc/Views/ImageGallery/DesignerView.Simple.cshtml
Regards,
Velizar Bishurov
Telerik