Use external widget template file

If you want to use external (.ascx) files for your widget templates you must place them in WidgetTemplates folder that is in your website template folder. The following scheme displays the structure:

The content in your external widget template file is the same as the content of the template in the widget templates editor. You can use the same fields and syntax to achieve the desired result.

Applying external widget template

To apply an external widget template to a widget, perform the following:
  1. Go to Sitefinity’s backend (http://<yoursite>/sitefinity)
  2. Click Pages.
  3. Click the page that you want to edit.
  4. Add the widget to your page and open the advanced editing mode.
    For more information about adding and configuring widgets, see Widgets.
  5. Click ControlDefinition » Views.
  6. Select a view for the widget.
    For example, NewsFrontendDetails or NewsFrontendList.
  7. In field TemplatePath, enter the path to the widget template.
    For example: ~/App_Data/Sitefinity/WebsiteTemplates/YourTemplate/WidgetTemplates/Blogs/List/BlogList.ascx.
  8. Click Save.
    The advanced editing mode closes.
  9. To apply the changes to the page, click Publish.

    NOTE: A possible reason for an error message in the layout editor can be the incorrect path to the widget template.

Was this article helpful?