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.

Apply 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.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?