For widgets that inherit from SimpleView or SimpleScriptView classes, you change their template by setting the LayoutTemplatePath property to your own template value. This tutorial demonstrates how to set your own widget template to a widget that does not inherit from SimpleView or SimpleScriptView classes - the Download list widget.
The Download list widget displays documents and files in different ways according to the type you choose in the designer - List, Table, Table+Detail page, List+Detail page. You can customize the template for each of these types in the following way:
NOTE: Because there are required controls, when extending the template, you must add these controls to the new one. For example, such required control is the RadGrid with ID documentsGrid. Otherwise, you will receive A required control was not found in the template for . . . error.
NOTE: Because the template is created in SitefinityWebApp, the sample above uses a virtual path for the embedded custom template: "~/CustomPrefix/". For more information, see Taking advantage of the Virtual Path Provider.
By default FrontentMasterListViewName is used by the DocumentsDefintions. To load your custom template according to the setting chosen in the designer, check the viewName in the LoadView method, and set the LayoutTemplatePath property accordingly.
After this procedure, whenever you select a view from the Download list widget designer, the corresponding custom template is loaded.
Also, to make your templates editable from the UI, open Designer » Widget templates and store them as the default Download list templates.
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important